[clug] Fine tuning some last bash niggles
Kim Holburn
kim.holburn at anu.edu.au
Wed Nov 5 15:50:00 EST 2003
At 3:19 PM +1100 2003/11/05, Michael.James at csiro.au wrote:
>Bash still doesn't have a good "which" function.
>
>Under tcsh, which gives a complete answer.
>
>eg: Why does rm infuriatingly ask if I really mean it?
>
>tcsh> which rm
>aliased to "rm -i" # AHAH!
>tcsh> unalias rm
type rm
type -a rm
>
>Bash's "which" maintains a guilty silence.
>type -a which
which is /usr/bin/which
>
>Or:
>bash> ln -s real-dir soft-link-to-dir
>bash> cd soft-link-to-dir
>bash> pwd
>~/soft-link-to-dir
> # what! That's how I got here, not where I am
>bash> which pwd
>bash> # more guilty silence, so try this
>bash> /bin/pwd
>~/real-dir/
pwd -P
>
>So bash has not only subverted pwd
> with its own broken version
> but it won't tell you this has happened.
>
>And it still doesn't have "where" at all.
>"where" used to continue down the path
> reporting all the hits for a given command.
>
>The first listed will be what happens
> if you type the raw (pathless) command,
> the other possibilities follow in order.
>It was useful.
>
>--
>Michael James michael.james at csiro.au
>System Administrator voice: 02 6246 5040
>CSIRO Bioinformatics Facility fax: 02 6246 5166
--
--
Kim Holburn
Network Consultant - Telecommunications Engineering
Research School of Information Sciences and Engineering
Australian National University - Ph: +61 2 61258620 M: +61 0417820641
Email: kim.holburn at anu.edu.au - PGP Public Key on request
Life is complex - It has real and imaginary parts.
Andrea Leistra (rec.arts.sf.written.Robert-jordan)
More information about the linux
mailing list