Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by Perl Mouse (Chaplain)
on Dec 19, 2005 at 14:22 UTC ( [id://517732]=note: print w/replies, xml ) Need Help??


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

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:>*

Replies are listed 'Best First'.
Re^4: Difference between a perl script & shell script
by tirwhan (Abbot) on Dec 19, 2005 at 14:40 UTC

    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

      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.

      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:>*

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-23 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found