LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-23-2010, 10:11 AM   #1
msrk
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Rep: Reputation: 0
shabang lines don't work on my guru plug


I have a GuruPlug computer running Debian Lenny.

I put a perl script on it with the following shabang line.

#!/root/bin/perl -w

When I run the program from the command line I get the following
message.


guru:~/bin$ ./ms_sync.pl
-bash: ./ms_sync.pl: /root/bin/perl: bad interpreter: Permission
denied

The permissions are:

guru:~/bin$ ls -al ms_sync.pl
-rwxr----- 1 ms users 11772 2010-06-17 10:48 ms_sync.pl

When I run 'which perl' the path I used is confirmed.
This perl script works on several other debian computer.

I can run perl and I can invoke the script as an arg to perl like
this:

guru:~/bin$ perl ms_sync.pl

Which works fine.

I think this has something to do with the way the root partition is
mounted. However, there seems to be a little guru black magic going
on to get the root partition mounted since it isn't in /etc/fstab. If
I enter mount on the command line I find the following line.

rootfs on / type rootfs (rw)

I cannot tell how it is mounted.

bash, perl, python, etc work but they all have this problem when
invoked via a shebang line.

How can I get shebang lines to work?

Thank you,
Marc
 
Old 07-23-2010, 10:15 AM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555
Any chance the following works as a shebang?

Code:
#!/bin/env/perl -w

or maybe:

#!/usr/bin/env perl -w
Note: I have never heard of a "GuruPlug" so forgive me if this doesn't apply; and, I don't typically do this, so my syntax may be slightly adrift, but the point I'm trying to indicate is to use the `env` capability to locate the proper interpreter..

Last edited by GrapefruiTgirl; 07-23-2010 at 10:17 AM.
 
Old 07-23-2010, 10:15 AM   #3
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Hi msrk wel-come to LQ,

try as shebang
#!/usr/bin/perl
 
Old 07-25-2010, 05:01 AM   #4
msrk
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you all for the suggestions. After trying:

#!/bin/env/perl -w

It occurred to me that the problem may be the mount permissions of the disk holding the perl script rather than the disk holding perl itself. I was right. I had the 'noexec' option turned on. I remounted the disk without that directive and all is well.
 
Old 07-25-2010, 08:03 AM   #5
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555
Cool glad you found the problem. If you haven't yet, you could mark this [solved] using Thread Tools, from the menu near the top.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
jack plug in installation doesn't work! pvsandesh Linux - Laptop and Netbook 0 12-02-2008 12:41 PM
java plug in in firefox does not work nanjil SUSE / openSUSE 2 08-03-2007 08:41 AM
Java Plug-in will not work aaronruss Linux - Newbie 8 12-19-2004 07:47 PM
Accepting Shabang Scripts (Quick & Easy Question, Just Can't Find Answer) overbored Programming 3 03-24-2004 06:41 PM
Flash Plug-in in Opera doesn't seem to work... ako Linux - Newbie 6 12-30-2003 01:04 PM

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

All times are GMT -5. The time now is 03:27 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