Submitted by "WONG SAI-KEE" to comp.unix.shell:
Quote:> I have no problem running `which' cmd and other cmds in bash/SuSE7.1.
> But whenever I invoke cmd from vi or a shell script, it complains
> which:: command not found
> but the cmd I want to execute simply works.
> Then I try to create a simply script which has one line:
> ls
> And the execution results in
> bash: which:: command not found
> 01 02 03 04 05 06 07 08 09 10 11 12
> Where the twelve numbers are the file under the current directory.
> Any clue ?
> SK
Did you recently edit your ~/.bashrc or ~/.bash_profile or any
other shell startup file?
My guess is that one of the shell startup file contains a line
that uses the 'which' command with a command name that doesn't
exist, maybe like this:
export VISUAL=$(which emaks)
'which' is usually not a shell built-in command.
--
Andreas K?h?ri
--------------------------------------------------------------
Stable, secure, clean, free: www.netbsd.org