aliases vs. shell functions (was Hard links vs. Soft links)

Robert Hartman hartman at ide.com
Thu Aug 30 02:33:57 AEST 1990


In article <2123 at wn1.sci.kun.nl> hansm at 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



More information about the Comp.unix.wizards mailing list