Re: script execution problem

This is a discussion on Re: script execution problem within the Linux General forums, part of the Linux Forums category; On Thu, 31 Jul 2003 19:59:26 +0200, "Elekaj34" <elekaj34@hotmail.com> wrote: >Hello &...


Go Back   Usenet Forums > Linux Forums > Linux General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-31-2003
Lew Pitcher
 
Posts: n/a
Default Re: script execution problem

On Thu, 31 Jul 2003 19:59:26 +0200, "Elekaj34" <elekaj34@hotmail.com> wrote:

>Hello
>
> I have installed a RedHat Linux 8.0 (on me home PC).
>
> In my /root directory, there is a file named 'jobs'.
> This file has the following attributes :
> -rwxr-xr-x 1 root root 1294 jui 31 19:47 jobs
>
> Tis file start with the following line :
> #! /bin/sh


Is that a space, between the #! and the /bin/sh ?
If so, remove it. The shebang line /should/ read

#!/bin/sh

with no spaces between the #! and the path to the interpreter

> When I try to run it, this is the result :
> : bad interpreter: No such file or directory


Yes.

> In the /bin directory, the file 'sh' exist.


If your shebang line is as you've transcribed it here, then it doesn't matter
whether or not there is a /bin/sh. The kernel isn't looking for file /bin/sh,
it's looking for " /bin/sh", which is a completely different file.

> Can you help me ?


Probably.

> I want to be able to run this file correctly


Try the script without the space in the shebang line, or reply with a better
transcription of the shebang line.

Good luck


--
Lew Pitcher
IT Consultant, Enterprise Technology Solutions
Toronto Dominion Bank Financial Group

(Opinions expressed are my own, not my employers')
Reply With Quote
  #2 (permalink)  
Old 07-31-2003
Peter T. Breuer
 
Posts: n/a
Default Re: script execution problem

Lew Pitcher <Lew.Pitcher@td.com> wrote:
> On Thu, 31 Jul 2003 19:59:26 +0200, "Elekaj34" <elekaj34@hotmail.com> wrote:


>> In my /root directory, there is a file named 'jobs'.
>> This file has the following attributes :
>> -rwxr-xr-x 1 root root 1294 jui 31 19:47 jobs
>>
>> Tis file start with the following line :
>> #! /bin/sh


> Is that a space, between the #! and the /bin/sh ?
> If so, remove it. The shebang line /should/ read


Space is fine and even normal, Lew!

> #!/bin/sh


> with no spaces between the #! and the path to the interpreter


Nope. Try it!

>> When I try to run it, this is the result :
>> : bad interpreter: No such file or directory


He probably has an extra ctl-M (\r) at the end of his line. Yadda
yadda. Written in msdos. Yadda.

Peter
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:39 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0