Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Running a shell script from Perl, and making that shell script accept input from perl script.

by jsegal (Friar)
on Apr 08, 2008 at 23:25 UTC ( #679105=note: print w/replies, xml ) Need Help??


in reply to Running a shell script from Perl, and making that shell script accept input from perl script.

Which queuing system are you using? I have used SGE, which requires a shell script for submission, but it is easy enough to write a single shell script wrapper, effectively:
--wrap.sh-- #!/bin/sh "$@"
---------

If you look at the shell docs, you will see that the $@ expands to all the arguments, and putting it in quotes ensures that any spaces in any of the argument values will still be quoted (i.e. they won't cause arguments to be split on spaces).

Then one can submit thusly:
qsub -o <log> -q <queue> [other qsub args] wrap.sh perl scriptname scr +iptargs
If you have a submitting job and the sub jobs that need to communicate, you can still use pipes if that makes sense. And obviously if you have the proper shebang line in your perl script you don't need to call perl explicitly.

Perhaps this trick will help you think of other ways to solve your issue.



--JAS
  • Comment on Re: Running a shell script from Perl, and making that shell script accept input from perl script.
  • Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2023-09-27 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?