U
Unix_Shell
Hello Group,
I am very new to the perl language and don't know much about it. I had
a question & maybe someone can help me decipher/modify a script.
We have AIX 5.2 & the script (test.sh) contains the following perl
command:
/usr/bin/perl
-014pe's|^|"'$PAGE1FORM'".(/Page:\s+1\s/?"\n":"'$CONTFORMSFX'\n")|e'
Basically, two values are being passed to this script. Variable
PAGE1FORM will contain $1 (example: "m_inv01") and CONTFORMSFX will
contain $2 (example: "_09").
Basically, the script is invoked as follows:
../test.sh m_inv01 _09 < inrptfile > outrptfile
The perl command processes the inrptfile by substituting the first line
of page 1 with m_inv01 and substituting the first line from page 2
onwards with m_inv01_09 (concatenation of $1 & $2).
Question: How can I make it substitute something completely different
from page 2 onwards? So, if I run the script as follows:
../test.sh m_inv01 pg2form < inrptfile > outrptfile
I would like the perl command to substitute the first line of page 1
with m_inv01 (just like above); however I would like it to substitute
the first line from page 2 onwards with pg2form (i.e. with whatever I
pass as $2 and *not* a concatenation of $1 and $2).
Thanks for any help.
S
I am very new to the perl language and don't know much about it. I had
a question & maybe someone can help me decipher/modify a script.
We have AIX 5.2 & the script (test.sh) contains the following perl
command:
/usr/bin/perl
-014pe's|^|"'$PAGE1FORM'".(/Page:\s+1\s/?"\n":"'$CONTFORMSFX'\n")|e'
Basically, two values are being passed to this script. Variable
PAGE1FORM will contain $1 (example: "m_inv01") and CONTFORMSFX will
contain $2 (example: "_09").
Basically, the script is invoked as follows:
../test.sh m_inv01 _09 < inrptfile > outrptfile
The perl command processes the inrptfile by substituting the first line
of page 1 with m_inv01 and substituting the first line from page 2
onwards with m_inv01_09 (concatenation of $1 & $2).
Question: How can I make it substitute something completely different
from page 2 onwards? So, if I run the script as follows:
../test.sh m_inv01 pg2form < inrptfile > outrptfile
I would like the perl command to substitute the first line of page 1
with m_inv01 (just like above); however I would like it to substitute
the first line from page 2 onwards with pg2form (i.e. with whatever I
pass as $2 and *not* a concatenation of $1 and $2).
Thanks for any help.
S