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


Click here to return to the 'Newbie script problem' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Newbie script problem
Authored by: ceevee on Apr 17, '02 02:24:04PM

I'm sure this will be obvious to the non-newbies out there, but I can't figure out what I'm doing wrong here. Here's what I did:

* copied the script into BBEdit
* saved it as "getweatherscript" into my home directory
* chmod 755 getweatherscript (in Terminal)
* rehash (in Terminal)

I try typing "getweatherscript" and it says "getweatherscript: Command not found."

What am I leaving out?



[ Reply to This | # ]
Newbie script problem
Authored by: Anonymous on Apr 17, '02 06:36:05PM

Wherever you saved the file to (your home directory, apparently) isn't in your PATH. Thus, you must move it to a directory in your PATH variable, or use explicit paths when running the app. eg:

% /Users/jdoe/getweather

or, if you are currently in your home directory:

% ./getweather



[ Reply to This | # ]
Newbie script problem
Authored by: ceevee on Apr 18, '02 10:02:36AM

Should have mentioned that I did try to use the absolute path. So trying it as /Users/ceevee/getweatherscript gives the same "command not found" error. I tried making a bin subdir in my user folder; still doesn't work... and /Users/ceevee/bin seems to be in my PATH. If I do "echo $PATH" it shows me /Users/ceevee/bin as one of the paths.



[ Reply to This | # ]
Newbie script problem
Authored by: George Frederick on Apr 19, '02 01:44:46PM

I had the same problem. The script isn't working for me.

Sounded kind of neat too. Oh well.



[ Reply to This | # ]
Newbie script problem
Authored by: ceevee on Apr 18, '02 04:49:01PM

OK, sorry for these messages but I did finally figure it out myself. When I saved the files out of BBEdit I didn't check the line ending style used. Using Mac line endings does NOT work. I changed to Unix line breaks and the scripts work fine now.



[ Reply to This | # ]