what's the use of "{ list }" in /bin/sh?
Leo de Wit
leo at philmds.UUCP
Sat Jul 9 21:35:40 AEST 1988
In article <Jul.7.21.58.09.1988.29598 at topaz.rutgers.edu> ron at topaz.rutgers.edu (Ron Natalie) writes:
>> Besides obvious uses mentioned in previous articles thus far,
>> recent Bourne shells allow a rudimentary aliasing using "{" and "}".
>
>Rudimentary? Shell functions are much more powerful and straight
>forward that the Csh alias kluding.
Another shell war flaming up? Or hasn't the old one finished yet?
En garde!
B.T.W. even the standard Bourne shell allows for some kind of
'functions', be it without arguments (but you can use shell variables);
ever heard of eval? It is more powerful than the alias mechanism (at
least I think it is; don't use csh myself). The only drawback is that
you have to put 'eval' in front of the stuff to be evaluated; but then,
this isn't so bad, since you see at last what you're doing. I dislike
an alias like: alias rm 'rm -i' for the same reason I dislike using
scripts or programs with the same name as existing ones - unless of
course you have to.
Leo (slogan='echo $USER: Bourne to be wild 8-\)'; eval $slogan)
More information about the Comp.unix.questions
mailing list