Question on perl script.
From: Unix-Shell (sgtembe_at_hotmail.com)
Date: 03/29/05
- Next message: clinton__bill_at_hotmail.com: "bash : how to reset environment variable settings"
- Previous message: Ed Morton: "Re: Is there a NOT operator in sed?"
- Next in thread: Icarus Sparry: "Re: Question on perl script."
- Reply: Icarus Sparry: "Re: Question on perl script."
- Reply: Michael Tosch: "Re: Question on perl script."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Mar 2005 08:45:03 -0800
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: (the command was posted by one of the members in response to a
query few months back)
/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
- Next message: clinton__bill_at_hotmail.com: "bash : how to reset environment variable settings"
- Previous message: Ed Morton: "Re: Is there a NOT operator in sed?"
- Next in thread: Icarus Sparry: "Re: Question on perl script."
- Reply: Icarus Sparry: "Re: Question on perl script."
- Reply: Michael Tosch: "Re: Question on perl script."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|