Re: file edit

2014-02-27 Thread Paul Johnson
On Wed, Feb 26, 2014 at 03:59:40PM +, jet speed wrote: Chaps, Any quick one liner code in perl were i can get rid off the before and after wwn each line for file as below file --- device name lz_09_red_e10 vsan 200 * fcid 0xef0013 [pwwn 50:00:00:00:99:00:66:7a] * fcid

file edit

2014-02-26 Thread jet speed
Chaps, Any quick one liner code in perl were i can get rid off the before and after wwn each line for file as below file --- device name lz_09_red_e10 vsan 200 * fcid 0xef0013 [pwwn 50:00:00:00:99:00:66:7a] * fcid 0xegg015 [pwwn 10:00:00:55:99:a8:d9:c4] [ pe-tgh10-hostb] device name

Re: file edit

2014-02-26 Thread Jim Gibson
On Feb 26, 2014, at 7:59 AM, jet speed speedj...@googlemail.com wrote: Chaps, Any quick one liner code in perl were i can get rid off the before and after wwn each line for file as below file --- device name lz_09_red_e10 vsan 200 * fcid 0xef0013 [pwwn

Re: file edit

2014-02-26 Thread jet speed
Thanks Jim and Paul, Appreciate your inputs. Sj. On Wed, Feb 26, 2014 at 4:47 PM, Paul Johnson p...@pjcj.net wrote: On Wed, Feb 26, 2014 at 03:59:40PM +, jet speed wrote: Chaps, Any quick one liner code in perl were i can get rid off the before and after wwn each line for file

Re: Inline file edit

2002-01-09 Thread Michael R. Wolf
[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

RE: Inline file edit

2002-01-09 Thread Yacketta, Ronald
] Subject: Re: Inline file edit [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

Re: Inline file edit

2002-01-09 Thread John W. Krahn
Ronald Yacketta wrote: From: [EMAIL PROTECTED] 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

Re: Inline file edit

2002-01-09 Thread Michael R. Wolf
Yacketta, Ronald [EMAIL PROTECTED] writes: Would I be able to use this inline? That is within a perl script itself? If so, might you provide an example? If you wanted to make a stand-alone perl script of it, it would look something like this. #! /usr/bin/perl -w $^I = .bak; while() {

RE: Inline file edit

2002-01-09 Thread Yacketta, Ronald
Subject: Re: Inline file edit Yacketta, Ronald [EMAIL PROTECTED] writes: Would I be able to use this inline? That is within a perl script itself? If so, might you provide an example? If you wanted to make a stand-alone perl script of it, it would look something like this. #! /usr

Re: Inline file edit

2002-01-09 Thread Michael R. Wolf
[EMAIL PROTECTED] (Michael R. Wolf) writes: Other alternatives include #! /usr/bin/perl -w -i #! /usr/bin/perl -w -i .bak $^I = undef; Oops! May have been misleading. Here's commentary on alternatives. $^I = ''; # in-place, but no backup $^I = '.bak'; # in-place, with backup

Re: Inline file edit

2002-01-09 Thread Michael R. Wolf
[EMAIL PROTECTED] (Ronald Yacketta) writes: This works great with one exception... the two values in the sed need to be passed into the script... IE: changedbsid.pl OLDSID NEWSID filename(s) could be ran against 1 or more files at a time. I havethis which works like a champ on a

RE: Inline file edit

2002-01-09 Thread Yacketta, Ronald
$_ in the background but no dice... could someone kindle point me in the right direction? regards -Ron -Original Message- From: Michael R. Wolf [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 09, 2002 15:59 To: [EMAIL PROTECTED] Subject: Re: Inline file edit [EMAIL PROTECTED] (Ronald

Inline file edit

2002-01-08 Thread Yacketta, Ronald
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