Difference between solaris and linux

J

James

Perl scripts with the following first line works in Solaris but fails
in Linux. Is there a way to make it work in Linux?

#!/bin/env perl -w
or
#!/bin/env perl # comment

James
 
R

Randal L. Schwartz

James> Perl scripts with the following first line works in Solaris but fails
James> in Linux. Is there a way to make it work in Linux?

James> #!/bin/env perl -w
James> or
James> #!/bin/env perl # comment

I'm surprised either of those work, actually.

The original shebang permitted only one argument after the command name
(in this case, the "perl" after "/bin/env"), and everything else was
either illegal or ignored.

In general, using /bin/env is wrong anyway. Put the right path and
you'll be happier.

print "Just another Perl hacker,"; # the original
 
S

sln

James> Perl scripts with the following first line works in Solaris but fails
James> in Linux. Is there a way to make it work in Linux?

James> #!/bin/env perl -w
James> or
James> #!/bin/env perl # comment

I'm surprised either of those work, actually.

The original shebang permitted only one argument after the command name
(in this case, the "perl" after "/bin/env"), and everything else was
either illegal or ignored.

In general, using /bin/env is wrong anyway. Put the right path and
you'll be happier.

print "Just another Perl hacker,"; # the original

Hey Randal, an aside, when you gonna teach me about regex, I need
lessons.

-sln
 
S

sln

Hey Randal, an aside, when you gonna teach me about regex, I need
lessons.

Don't get me wrong, I've seen at least 1 big regex you did in some
module, but I can remember. I do remember this simple little
regex you posted on this bb some time ago.
(expanded)
" (?: \\. | [^\\"]+ )* "

Wasn't ever sure of why the order of +* until i forced a left to
right discipline in my thought. I hope this is how you wrote it
because its done from memory. Extrordinary unique..

-sln
 
J

Justin C

Perl scripts with the following first line works in Solaris but fails
in Linux. Is there a way to make it work in Linux?

#!/bin/env perl -w
or
#!/bin/env perl # comment

Sure, move perl to /bin/env - what might be a little easier is building
perl on Linux with /bin/env as the target destination, then you can be
sure that everything is in the right place.

Good luck.

Justin.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top