Date: Thu, 10 Jun 2010 12:57:11 -0500 From: Dan Nelson <dnelson@allantgroup.com> To: Lowell Gilbert <freebsd-questions-local@be-well.ilk.org> Cc: freebsd-questions@freebsd.org, Dan D Niles <dan@more.net> Subject: Re: Switched to Bash and Comparison of Shells Message-ID: <20100610175711.GB5615@dan.emsphone.com> In-Reply-To: <44typa3hv7.fsf@be-well.ilk.org> References: <1276190395.5437.53.camel@jane.spg.more.net> <44typa3hv7.fsf@be-well.ilk.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jun 10), Lowell Gilbert said: > Dan D Niles <dan@more.net> writes: > > > The which command functions differently between bash and tcsh. For > > example, I have ls aliased to do color output and add some other options > > that I like. With tcsh, 'which ls' returns > > "ls: aliased to \ls -GFB"; with bash it returns > > "/bin/ls". The tcsh behavior tells you what will be executed when you > > run ls. The bash behavior can be achieved in tcsh with 'which \ls', so > > I think I like the tcsh behavior better. I could probably write a > > function in bash that emulates tcsh's builtin which command. > > bash (like most other sh-style shells) has no "which" builtin. You end up > running /usr/bin/which. bash (like most other sh-style shells) does have > a (rough) equivalent, which is "type". zsh's which command will prints the output of aliases, and a very comprehensive completion system, too. It also supports more csh features/syntax than bash (good for people used to csh/tcsh). (dan@dan.13) /home/dan> which ls ls: aliased to ls -Fa -- Dan Nelson dnelson@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100610175711.GB5615>