Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

How do I execute a list of Unix commands from inside a perl program

by Anonymous Monk
on Mar 28, 2000 at 00:01 UTC ( [id://6264]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am sending a file with a list of unix commands from client to server . On the server , how do I execute the commands?

Originally posted as a Categorized Question.

  • Comment on How do I execute a list of Unix commands from inside a perl program

Replies are listed 'Best First'.
Re: How do I execute a list of Unix commands from inside a perl program
by btrott (Parson) on Mar 28, 2000 at 00:26 UTC
    With extreme care.

    If you must do this, look at the system and exec commands in order to actually execute the commands. Pay particular attention to the multi-argument forms of both those functions, and use them, if possible--they're more secure.

    Also, read perlsec and run in taint mode (-T), and do security checks on the commands that the server receives.

Re: How do I execute a list of Unix commands from inside a perl program
by cleen (Pilgrim) on Feb 25, 2001 at 07:22 UTC
    IMHO with the information provided, it would be best to have the script on one server parse out the commands then do a form of remote command via ssh or kerberized (encrypted) rsh.
    open(CMDS, "file_of_commands"); while (<CMDS>) { chomp; # ssh -l username machine "$_"; }
Re: How do I execute a list of Unix commands from inside a perl program
by Anonymous Monk on Dec 04, 2003 at 05:26 UTC
    hi

    Originally posted as a Categorized Answer.

Re: How do I execute a list of Unix commands from inside a perl program
by Anonymous Monk on Mar 07, 2004 at 08:15 UTC
    open(CMDS, "file_of_commands"); while (<CMDS>) { chomp; # ssh -l username machine "$_"; }

    Originally posted as a Categorized Answer.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-24 07:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found