Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Difference between a perl script & shell script

by matija (Priest)
on Dec 19, 2005 at 13:54 UTC ( #517723=note: print w/ replies, xml ) Need Help??


in reply to Re: Difference between a perl script & shell script
in thread Difference between a perl script & shell script

Actualy, one of the first "I love perl" moments, for me came when I was moving programs between an SGI and a SunOs machine, back in the time when Perl was at version 4.19 and dinosaurs roamed the earth.

For some reason, the user shell on the SunOS (not in general, just on that particular machine) was mandated to be tcsh, and on the SGI it was bash. Or maybe it was the other way around.

Either way, porting shell scripts was a pain, porting C programs was a pain, but Perl scripts simply copied over. Nifty...


Comment on Re^2: Difference between a perl script & shell script
Re^3: Difference between a perl script & shell script
by Perl Mouse (Chaplain) on Dec 19, 2005 at 14:22 UTC
    For some reason, the user shell on the SunOS (not in general, just on that particular machine) was mandated to be tcsh, and on the SGI it was bash. Or maybe it was the other way around.
    I don't get this. Just because a users shell is tcsh doesn't mean that every shell program needs to be in tcsh - if the top line says #!/usr/bin/sh, it will be run in sh, regardless of the users shell.

    The only exception being shells that need to be "sourced" - but you can't write those in Perl anyway (unless your shell is Perl).

    Perl --((8:>*

      Unless the admin has done

      ln -s /usr/bin/sh /usr/bin/csh

      And/or for added entertainment value:

      $ stat -c %N /usr/bin/csh ,,/usr/bin/csh" -> ,,/bin/bash"

      Yes I've seen this on production systems :-/. I personally find it much easier to test and rely on Perls $] than the various wacky shell configurations out there. YMM undoubtedly V.


      Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan
        Yeah, but that's a severly broken system. You might as well have a system admin that does
        ln -s /usr/bin/python /usr/bin/perl
        and suddenly your shell scripts are more portable.
        Perl --((8:>*

        Crap like that is one of the reasons that they kept the sysadmins in a different, secure building in my last Unix-universe (actually, AIX) position. The sysadmins also did such lovable actions as neglecting to renew compiler licenses, which made it a trifle tough to get any work done. They would also change the directory structure without telling anybody.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://517723]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-04-23 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (555 votes), past polls