Try this (while logged into a shell)
/bin/sh
echo "#!`which perl` -w" > file
echo "print (\"Hello World\\\n\");" >> file
chmod 755 file
./file
It shoudl print "Hello World"
Also if there is a space between the # and the ! it will give an error ('_'
means space here)
#_!/usr/bin/perl_-w (wrong)
_#!/usr/bin/perl_-w (wrong)
#!_/usr/bin/perl_-w (wrong)
#!/usr/bin/perl_-w (right)
The only space that should be in there is for the "-w" flag.
Also do a `which perl` and `whereis perl`
then do a `perl -v` and it should print out some version information.
Oh, RedHat I just seen that. One of their distro had a glitch in it,
causeing Perl not to work correctly. What version are you using? IIRC
RedHat 5.0 *or* RedHat 5.1 had this glitch with Perl in it. I know for a
fact 5.2 does NOT have the glitch, 6.x shouldn't have this problem either.
If you are running 5.0 or 5.1 please check http://www.redhat.com and get
some more information there, I forget which version has the bug in it, but
either way you should check it out.
Jack
----- Original Message -----
From: Dan Browning <[EMAIL PROTECTED]>
To: Greg Olszewski <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, March 23, 2000 1:14 PM
Subject: RE: Getting RedHat to understand the perl shebang
> Maybe these will help?
>
> # ./configure.pl
> bash: ./configure.pl: No such file or directory
> # perl ./configure.pl
> (script runs as normal)
> # ls -la /usr/bin/perl:
> -rwxr-xr-x 2 root root 517052 Aug 30 1999 /usr/bin/perl
> # head -n 1 configure.pl
> #!/usr/bin/perl
> # ls -la configure.pl
> -rwxr-xr-x 1 root administ 2528 Mar 22 20:04 configure.pl
>
> /home, the dir I'm in, is not mounted no-exec. Any other ideas?
>
>
> Dan Browning
> Network Administrator
> Cyclone Computer Systems
>
> > -----Original Message-----
> > From: Greg Olszewski [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, March 22, 2000 8:09 PM
> > To: Dan Browning
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: Getting RedHat to understand the perl shebang
> >
> >
> > On Wed, Mar 22, 2000 at 08:02:51PM -0800, Dan Browning wrote:
> > > I cannot execute perl scripts ala: "./dostuff.pl", even with the
correct
> > > #!/usr/bin/perl, and 755 permissions. I have to prepend "perl"
> > in order to
> > > exec the script. Any guesses on this one?
> > >
> > The partition it's on is mounted noexec?
> >
> > Dunno... What error do you get(exactly)? Is perl actually in /usr/bin?
> > > 64mb RAM on SCSI.
> > Ouch! Access time must kill you :-)
> >
> > have fun,
> >
> > greg
> > --
> > dronf!
> >
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to [EMAIL PROTECTED]
> Please read the FAQ at http://www.linux-learn.org/faqs
>
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs