Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'command not found' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
command not found
Authored by: shack on Nov 10, '01 12:27:26AM
Okay, I'm baffled. Saved this into my ~/bin directory. chmod 755 itunes. rehashed. Command not found. Closed all Terminal instances and tried again. Command not found.
[open-131-161-241-7:~] shacker% rehash
[open-131-161-241-7:~] shacker% which itunes
/Users/shacker/bin/itunes
[open-131-161-241-7:~] shacker% itunes
itunes: Command not found.
[open-131-161-241-7:~] shacker% echo $PATH
/Users/shacker/bin/powerpc-apple-darwin:/Users/shacker/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
[open-131-161-241-7:~] shacker%
This makes no sense. What am I missing? There are other things in my ~/bin that work fine. What the heck?

[ Reply to This | # ]
Very strange
Authored by: robg on Nov 10, '01 01:54:28AM

I had mine in /usr/local/bin, but just moved it to check. Works fine, and my path matches yours (more or less; it includes the ~/bin, which is what counts).

It's very odd that 'which' will give you the right answer but it still won't run. I'll email you my saved script privately, just in case there's something odd there.

-rob.



[ Reply to This | # ]
command not found
Authored by: Taran137 on Nov 10, '01 09:28:37AM

I am having the same problem as robg.



[ Reply to This | # ]
command not found
Authored by: jimhill on Nov 10, '01 09:08:48PM

The command which is not found is probably not the itunes script, since "which" found it with no problems. Look at system executables that this scripts calls: /bin/sh, and osascript. Try "which"ing each of them and see if the machine has trouble finding either. Dollars to donuts it'll be osascript that's the offender, since I'd be pretty baffled if you managed to get an OS X installation without /bin/sh.



[ Reply to This | # ]
command not found
Authored by: Taran137 on Nov 11, '01 01:12:16PM

[localhost:~] taran% which osascript
/usr/bin/osascript

[localhost:~] taran% which sh
/bin/sh

[localhost:~] taran% which itunes
/Users/taran/bin/itunes

That is not it.



[ Reply to This | # ]
command not found
Authored by: _merlin on Nov 11, '01 06:32:43PM

Check your script for typos



[ Reply to This | # ]
solved! - command not found
Authored by: tcurtin on Jan 17, '03 05:12:00PM

I'm guessing you had the same problem as me - it has to do with the line breaks in the file you copied over. I selected the text on the macosxhints page, and dragged it over into BBEdit. "command not found"

Open terminal, cd into the directory containing the script, and type
more itunes (or whatever you called the script)

You'll only see a few lines, all garbled. The fix (for me) was to change from Macintosh to Unix newlines using BBEdit. You can download a trial version that will let you do this - you can also do it using sed or perl, but I don't have the time now to create the script, and it would probably just cloud the issue anyway. :)

Good luck!



[ Reply to This | # ]
"option" not found
Authored by: dlgraves on Mar 17, '03 12:05:08PM

hi

I have a similar problem: the 'itunes' script runs but breaks when it gets to this line:

echo \"Usage: `basename $0` <option>\";

At that point the script says:

/Users/dlg/bin/itunes: option: No such file or directory

Does anyone understand what's going on? If this is an error within the script I don't see how it could work for other people.
Thanks a lot.

Lucas



[ Reply to This | # ]
"option" not found
Authored by: logo on Mar 18, '03 04:16:47AM

>> echo \"Usage: `basename $0` <option>\";

Remove the backslashes!

Currently you echoing " and then issuing the command with read input (<) from option...
and not an echo of the string containing "...<option>"

HTH



[ Reply to This | # ]
"option" not found
Authored by: mervTormel on Mar 18, '03 12:37:44PM

it's a little more complicated than that.

basename can take an argument, and if $0 is -bash (interactive bash shell), then basename gaks on the -switch.

so, pass basename the -- switch so that it stops processing arguments...

echo "Usage: `basename -- $0` <option>";

this works on the command line; you may need to quote it up some for your shell/script



[ Reply to This | # ]