"which:: command not found" in bash/SuSE7.1

"which:: command not found" in bash/SuSE7.1

Post by WONG SAI-KE » Wed, 11 Sep 2002 12:00:21



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

 
 
 

"which:: command not found" in bash/SuSE7.1

Post by Andreas K?h?r » Wed, 11 Sep 2002 12:48:24


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

 
 
 

"which:: command not found" in bash/SuSE7.1

Post by WONG SAI-KE » Wed, 11 Sep 2002 16:40:26


: 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.

Thank you.  I haven't been aware of this.

SK

 
 
 

1. bash error - "bash: setenv: command not found"

When I login to my account on a SparcStation 10 running SunOS 4.1.3,
bash (2.02.0) gives me the error above.  The strange thing is, I don't
use "setenv" anywhere in my .bashrc or .bash_profile (or anywhere else
in any file in my home directory).

When I built it, make check revealed no problems.

Any ideas would be appreciated it.

--
Jon Bernard

2. AIX 3.2 and shrinking jfs?

3. "find" and "locate" commands not working, linux RH5.2

4. Powermac 6500 Geoport Modem Question

5. How does dump calculate tape size?

6. X-probeonly- program says "bash" command X not found ???

7. Latest MkLinux kernel?

8. startx "bash: startx: command not found"

9. "bash: id:command not found"

10. GETSERVBYNAME()????????????????????"""""""""""""

11. Cygwin bash "id -un" returns "Administrator" when I'm not

12. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""