Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

running perlscript from shell script

by keralaqueen234 (Initiate)
on May 06, 2013 at 11:02 UTC ( #1032243=perlquestion: print w/replies, xml ) Need Help??
keralaqueen234 has asked for the wisdom of the Perl Monks concerning the following question:

hi ,

i have a requirement wherein i have 3 perlscripts say, and i need to execute these three pearl scripts from inside a shell script, by passing arguments. example would be like , i have a shellscript named .inside this shell script i have called the 3 perlscripts . So on executing the shellscript (by passing arguments arg1 arg2, it should execute the 3 perl scrits called inside. these 3 perlscripts also need the passed arguments . in short if i call arg1 arg 2, this inturn calls arg1 arg2, arg1 arg2, arg1 arg2 . how to do ths? </p

Replies are listed 'Best First'.
Re: running perlscript from shell script
by choroba (Bishop) on May 06, 2013 at 11:18 UTC
    This is not a Perl question, it is a shell question. The answer depends on what kind of shell you run; but usually, the following should work: "$@" "$@" "$@"

    "$@" stands for "all the arguments".

    If only particular arguments are needed, you can use the positional arguments: "$2" # Only the second argument.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: running perlscript from shell script
by zwon (Abbot) on May 06, 2013 at 11:21 UTC
    sh, check the "special parameters" section.
Re: running perlscript from shell script
by Anonymous Monk on May 07, 2013 at 01:21 UTC


    For me the real question is - why are you running a shell script at all?

    And why 3 Perl progs?

    You are passing the same args into all the progs. Why not just pass them into one prog and do all the work of the three progs in one go?

    I would give it a bit more thought.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1032243]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2017-11-18 00:00 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (276 votes). Check out past polls.