Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!nisca.ircc.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!bloom-beacon!eru!luth!sunic!mcsun!hp4nl!sci.kun.nl!cs.kun.nl!hansm From: hansm@cs.kun.nl (Hans Mulder) Newsgroups: comp.unix.wizards Subject: aliases vs. shell functions (was Hard links vs. Soft links) Summary: /bin/sh does not support aliases Keywords: alias, /bin/sh, shell function Message-ID: <2123@wn1.sci.kun.nl> Date: 28 Aug 90 10:04:40 GMT References: <1084.26d2a42b@desire.wright.edu> <13646@ulysses.att.com> <2866@wyse.wyse.com> <738@primerd.PRIME.COM> Sender: root@sci.kun.nl Organization: University of Nijmegen, The Netherlands Lines: 45 In article <738@primerd.PRIME.COM> milgr@teapot.prime.COM (Marc Milgram) writes: >In article <2866@wyse.wyse.com>, bob@wyse.wyse.com (Bob McGowen x4312 >dept208) writes: >|>As for using aliases for this function, only csh and ksh (if you have it) >|>would be able to do this. . . . >aliases work in the bourne shell No, they don't. > (at least all of the /bin/sh's that I have used.) Apparently, you have only used SysV-derived Un*xen. >For example: > >ls() >{ > /bin/ls -CFb $@ >} This is not an alias, it's a shell function. Some /bin/sh's support these, others don't. In particular, the /bin/sh that came with V7 didn't and consequently the /bin/sh that comes with 4.[0-3]BSD still doesn't. 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. Hope this clarifies things a bit, Hans Mulder hansm@cs.kun.nl