LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-29-2001, 08:20 PM   #1
chuck77
Member
 
Registered: Nov 2001
Location: singapore
Posts: 120

Rep: Reputation: 15
Shell script error.


I downloaded a backup script: hostdump.sh
When i stored in one of the directory and run it.
it says "bash: command not found"

Let say, i store the script in /tmp

#cd /tmp
#./hostdump.sh
#"bash: ./hostdump.sh : no such file or directory"

or

#hostdump.sh
#"bash: hostdump.sh : command not found"


How do i solve it ? pls advise...
Thanks...
 
Old 11-29-2001, 09:15 PM   #2
WindozBytes
Member
 
Registered: Aug 2001
Location: CT, USA
Distribution: Mandriva 2008
Posts: 105

Rep: Reputation: 15
This looks like the executable bit may not be set properly. Try

# chmod +x filename
 
Old 11-29-2001, 10:18 PM   #3
chuck77
Member
 
Registered: Nov 2001
Location: singapore
Posts: 120

Original Poster
Rep: Reputation: 15
Hi.

I did the chmod operation before that.

#chmod 755 hostdump.sh


It really puzzle me..tat the script still don't work.
 
Old 11-29-2001, 11:30 PM   #4
speck
Member
 
Registered: Nov 2001
Location: US
Distribution: Slackware 14.2
Posts: 375

Rep: Reputation: 115Reputation: 115
I think I know what your problem is. Open the script in an editor and look at the first line. You should see something like "#! /usr/bin/sh". I'm guessing that the path in that line is incorrect.

Type "whereis bash" and you should see "bash: /bin/bash". Now edit the file and change the first line to "#! /bin/bash" (if your whereis command returned a different path than my example, just change it to your path.)

Speck
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script help required syntax error sridhar11 Programming 1 10-31-2005 08:38 AM
Exiting the Shell script with Error MEssage sumitarun Programming 5 04-14-2005 01:10 AM
Help With A Shell Script Error PhantomFX Linux - Newbie 3 02-17-2005 04:42 AM
shell script q's (io, error exiting ) dave bean Programming 6 02-17-2005 01:24 AM
Shell Script Error Gerardoj Linux - General 2 12-03-2003 09:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration