[clug] Fine tuning some last bash niggles

Michael.James at csiro.au Michael.James at csiro.au
Wed Nov 5 15:19:34 EST 2003


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

Bash's "which" maintains a guilty silence.

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/

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



More information about the linux mailing list