5

I am trying to run openscad from the command line and it throws an error, but if I type out the whole path reported by which it seems to work as shown below.

[dataproc@Euclid ~]$ which openscad
/usr/bin/openscad
[dataproc@Euclid ~]$ openscad
bash: /usr/local/bin/openscad: No such file or directory
[dataproc@Euclid ~]$ /usr/bin/openscad
[dataproc@Euclid ~]$ #this worked

I am totally clueless as to what is going on here, any help would be greatly appreciated.

2 Answers2

6

which lies; it can report things based on an idealized situation as gleaned from your shell startup files, while missing some possibilities and not catching any changes not made by the standard files. Use type to see what the shell really thinks is going on.

2@mress:1 B$ type which
which is /usr/bin/which

External commands simply can't tell what will really happen, because they have to guess at functions and aliases based on your startup files and won't know about things created by autoload mechanisms; you need to ask the shell itself what it will do.

2@mress:2 B$ type type
type is a shell builtin
geekosaur
  • 12,091
0

Without knowing your .profile (.bashrc, etc) only guessing, than you have somewhere

alias openscad=/usr/local/bin/openscad

and that is why your bash trying run /usr/local/bin/openscad and not the default one in /usr/bin.

clt60
  • 887