BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old May 25th, 2003, 12:34 PM
ktoz ktoz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 440 ktoz User rank is Sergeant (500 - 2000 Reputation Level)ktoz User rank is Sergeant (500 - 2000 Reputation Level)ktoz User rank is Sergeant (500 - 2000 Reputation Level)ktoz User rank is Sergeant (500 - 2000 Reputation Level)ktoz User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 13 h 54 m 8 sec
Reputation Power: 25
Simplest of shell scripts not working

I'm trying to write my first shell script and find that even something as simple as this doesn't work:

script file name is: test.sh
script file location is: ~/bin

script code is:

#!/bin/sh
echo "Hello world"

I did a "chmod 755 test.sh" on the file cd to the ~/bin directory and get the following when trying to run the command:

[computer:~] testuser% ./test.sh
./test.sh: Command not found.

Are there any special shell-script related quirks to be aware of in OS 10.2.6?

(Note: also did a echo $PATH and my /bin directory is listed so the system shouldn't have any trouble locating the script right?)

Thanks for any help,

Ken

Reply With Quote
  #2  
Old May 25th, 2003, 06:45 PM
ktoz ktoz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 440 ktoz User rank is Sergeant (500 - 2000 Reputation Level)ktoz User rank is Sergeant (500 - 2000 Reputation Level)ktoz User rank is Sergeant (500 - 2000 Reputation Level)ktoz User rank is Sergeant (500 - 2000 Reputation Level)ktoz User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 13 h 54 m 8 sec
Reputation Power: 25
After much headscratching on this one, it turns out that the problem was caused by Mac style line enders rather than Unix line enders. Once the line enders were changed, everything worked fine.

Hope this helps someone else...

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > Simplest of shell scripts not working


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway