Help answer threads with 0 replies.
Go Back > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.


  Search this Thread
Old 10-26-2004, 12:46 PM   #1
LQ Newbie
Registered: Oct 2004
Posts: 5

Rep: Reputation: 0
Redhat AS 3, shell/script question

When trying to run a backup script titled it gives an error: bash: command not found. If I run sh it runs fine. The 1st line of the script is #!/bin/ksh and I verified that the path is correct. I have tried changing this to bin/sh or #!/bin/bash with no help, same error. Again, if I type sh before the name of the script, it runs fine. Does anyone know a solution to this? Sorry if this is a newbie type question.
Any help would be greatly appreciated.
Thank you.
Old 10-26-2004, 12:57 PM   #2
Senior Member
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
$ chmod ug+x
(you could just do chmod +x if you want everyone to be able to execute it)

If you've already confirmed that it's executable, then you need to specify the path to it because it's not in your environment. If you're in the same directory, do:
$ ./
if you're not in the same directory, do:
$ /path/to/yourfile/

If you're root, you should absolutely not add . to your PATH environment, because that can be used to easily trick the root user into running trojaned commands.
Old 10-26-2004, 01:15 PM   #3
LQ Newbie
Registered: Oct 2004
Posts: 5

Original Poster
Rep: Reputation: 0

I did have execute permissions and you were absolutely right about the path. Thank you for the help, you rock!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script question Whiteghost Programming 17 09-10-2005 07:52 PM
Another shell script question J_Szucs Programming 4 09-10-2005 03:47 PM
Shell script question. pete1234 Programming 10 09-06-2005 03:46 AM
Shell Script Question. rvijay Linux - General 2 07-14-2005 07:41 PM
Shell script question rytrom Linux - Newbie 4 01-28-2004 08:20 AM > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 11:34 PM.

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