Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!ide!hartman From: hartman@ide.com (Robert Hartman) Newsgroups: comp.unix.wizards Subject: Re: aliases vs. shell functions (was Hard links vs. Soft links) Keywords: alias, /bin/sh, shell function Message-ID: <1990Aug29.163357.9849@ide.com> Date: 29 Aug 90 16:33:57 GMT References: <1084.26d2a42b@desire.wright.edu> <13646@ulysses.att.com> <2866@wyse.wyse.com> <738@primerd.PRIME.COM> <2123@wn1.sci.kun.nl> Sender: bert@ide.com (Bert Beaton) Organization: IDE, San Francisco Lines: 30 In article <2123@wn1.sci.kun.nl> hansm@cs.kun.nl (Hans Mulder) writes: >... >The Korn shell supports both aliases and shell functions; you can say either: > >alias ls="/bin/ls -CBb" > >or: > >ls() >{ > /bin/ls -CFb "$@" # Note the "" >} > >and the effect is pretty much the same. >... One further point. A Korn shell alias does not handle command-line arguments. The Korn equivalent to a C-shell alias such as: alias svi 'sccs edit -s \!*; vi \!*; sccs delget -s \!*' would be: svi() { # edit SCCS files sccs edit -s "$@" vi "$@" sccs delget -s "$@" } -r