Difference between solaris and linux

Discussion in 'Perl Misc' started by James, Dec 30, 2010.

  1. James

    James Guest

    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
     
    James, Dec 30, 2010
    #1
    1. Advertising

  2. >>>>> "James" == James <> writes:

    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

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <> <URL:http://www.stonehenge.com/merlyn/>
    Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
    See http://methodsandmessages.posterous.com/ for Smalltalk discussion
     
    Randal L. Schwartz, Dec 30, 2010
    #2
    1. Advertising

  3. James

    Guest

    On Thu, 30 Dec 2010 15:31:14 -0800, (Randal L. Schwartz) wrote:

    >>>>>> "James" == James <> writes:

    >
    >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
     
    , Dec 30, 2010
    #3
  4. James

    Guest

    On Thu, 30 Dec 2010 15:49:40 -0800, wrote:

    >On Thu, 30 Dec 2010 15:31:14 -0800, (Randal L. Schwartz) wrote:
    >
    >>>>>>> "James" == James <> writes:

    >>
    >>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.
    >


    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
     
    , Dec 31, 2010
    #4
  5. James

    Justin C Guest

    On 2010-12-30, James <> wrote:
    > 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.

    --
    Justin C, by the sea.
     
    Justin C, Dec 31, 2010
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page