Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!dsill@NSWC-OAS.arpa From: dsill@NSWC-OAS.arpa (Dave Sill) Newsgroups: comp.unix.wizards Subject: Re: Summary of Emacs csh alias replies Message-ID: <10849@brl-adm.ARPA> Date: 15 Dec 87 04:18:16 GMT Sender: news@brl-adm.ARPA Lines: 34 >} is Dave Sill > is Barton Schaefer >}Some suggested putting the if-then- >}else in a file to be sourced by the alias. This works, but requires >}reading the file each time the alias is invoked, so I might as well >}use a script. > >"Might as well use a script" ?!?!? > >For something as short as the 6 or 7 lines in the file in question, the >major part of the overhead is NOT in reading the file, but in fork-execing a >new shell which then has to read the file anyway. Sourcing the file from the >current shell will be MUCH faster than running a script. You're right. The fork/exec overhead *is* higher than the file I/O overhead, but I still want to avoid both, if possible. Your solution requires reading the sourced file, a fork/exec of grep, and the use of a temporary file. There should be a more efficient way. Probably the best way to do this is to modify csh. >Furthermore, what do you think is going to happen when you issue a "%emacs" >in the script? There isn't any background job running under the script shell! You're right again. I guess I fell into the same trap that got those who suggested piping "jobs" to grep. ====== The opinions expressed above are mine. Willy Wonka: But don't ever forget what happened to the man who suddenly got everything he ever wanted. Charlie: What's that? Willy: He lived happily ever after.