How to pass arguments to perl

M

moonhkt

Hi All
In kshell, how to past argument to perl ?

In kshell, I have Funciton PROECSS(), how to pass string1 and string2
to perl ?

PROCESS ()
{
S1="ABC"
S2="testing"

perl -ni -e -v 1' $_ =~ s/ABC/testing/;
{
print $_ ;
}
' $FN
}

moonhkt
 
U

Uri Guttman

m> Hi All
m> In kshell, how to past argument to perl ?

m> In kshell, I have Funciton PROECSS(), how to pass string1 and string2
m> to perl ?

read perldoc perlrun and it tells you how to pass args to perl on the
command line.

uri
 
C

ccc31807

In kshell, how to past argument to perl ?

If you run a Perl script in a shell instance, your command line
arguments are contained in the @ARGV array. In this respect, Perl is
similar to the main() function in a C program.

CC.
 
M

moonhkt

If you run a Perl script in a shell instance, your command line
arguments are contained in the @ARGV array. In this respect, Perl is
similar to the main() function in a C program.

CC.

Thank. Update my script as below
PROCESS ()
{
echo $SOU
echo $TAR
perl -pi -e "s/${SOU}/${TAR}/ig" $FN
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top