Take the 2-minute tour ×

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

share|improve this question

migrated from stackoverflow.com May 29 '11 at 21:02

This question came from our site for professional and enthusiast programmers.

What does type openscad produce? –  Chris May 28 '11 at 4:21
whats the output of echo $PATH –  phoxis May 28 '11 at 4:21

2 Answers 2

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
share|improve this answer
Everything you wrote is correct, but didn't answer why his bash returning for the simple "openscad", "/usr/local/bin/openscad: No such file or directory". –  kobame May 28 '11 at 7:12
@kobame: neither I nor anyone else can know the answer without knowing the output of type openscad. Which is what I tried to explain; apparently I failed. –  geekosaur May 28 '11 at 7:16
[dataproc@Euclid ~]$ type openscad openscad is hashed (/usr/local/bin/openscad) –  shawn May 28 '11 at 14:54
I am not sure what "openscad is hashed" means but there was no alias for the command. Thank you all for the quick response. –  shawn May 28 '11 at 14:54
@shawn: Run hash -r and then type openscad again. Looks like it may have been in /usr/local/bin, got moved, and the shell didn't update its internal location hash. –  geekosaur May 28 '11 at 14:56

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.

share|improve this answer

Your Answer

