[EMAIL PROTECTED] (Ronald Yacketta) writes:

> Folks,
> 
> looking for a clean way to change a value in a file on the fly before it is
> processed (ran).
> I have a perl script that kicks off several resource scripts (.scr) that are
> NOT a valid shell script and can not be ran from the command line alone. I
> need a way to modify these .scr scripts on the fly to change 2 values in the
> script based on user supplied input to the .pl script.
> 
> IE:
> 
> user enters a SID of _QAP2, but all the .scr files have a SID of _VALUTEST 
> I need to be able to change the SID in the .scr on the fly before it is ran.
> 
> Regards,
> Ron

Look at the -i flag.  It takes an optional argument, but it
sounds like you don't want to keep a backup so use it
without the arg.  Think about it carefully.  And test
**VERY** carefully.  If you get your code wrong, you've
messed it up for good.  Keep backups.  This is a very
*powerful* statement.  In the right hands it's very good,
else it's very bad

Something like this might work.

perl -e s/_VALUETEST/_QAP2/g -i original.scr

-- 
Michael R. Wolf
    All mammals learn by playing!
        [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to