Actually, my procedure is usually to run the sed and let the output come to
the terminal to verify what it thinks it¹s going to do, then run it again,
redirecting the output to ³someimportantconfigurationfile.new² (That¹s way
too long... How aobut ³sicf.new² for short). Then I look at the new file to
be sure everything still looks like I want it, and then I rename ³sicf² to
³scif.old², and ³scif.new² to ³scif².

I¹m generally not doing these from a script, as I¹m usually trying to change
something I hadn¹t thought of when I was setting up things and scripting
them out. I¹m not fond of ed and ex from the 3270 console, but they¹d
probably work just as well as sed. But then I¹d be way too tempted to just
ed the file and be done with it. (I know me; I¹d do it.)

There¹s interactive, there¹s batch and scripts, and then there¹s 3270, which
is ³not quite interactive².
-- 
   .~.    Robert P. Nix             Mayo Foundation
   /V\    RO-OC-1-13              200 First Street SW
 / ( ) \  507-284-0844           Rochester, MN 55905
^^-^^   ----- 
        "In theory, theory and practice are the same, but
         in practice, theory and practice are different."


> From: John Summerfield <[EMAIL PROTECTED]>
> 
> When sedding, I recommend first
>    cp /etc/someimportantconfigurationfile \
> /etc/someimportantconfigurationfile.bak
> 
> and then
> sed </etc/someimportantconfigurationfile \
>> /etc/someimportantconfigurationfile.bak \
>   etc
> 
> If at first you don't succeed, you can try again without recovering what
> you did wrong. It's also good documentation, for when you do the virtual
> paperwork later;-)
> 
> 
> Mostly, I do this in a script, and the script first tests for the
> existance of the backup, creates it if there isn't one. Then, it's just
> a matter of hacking and running until the script works.
> 
> Interactively, I'm more likely to use ed or ex, and we're back where we
> started;-)
> 
> 
> 
> -- 
> 
> Cheers
> John
> 
> -- spambait
> [EMAIL PROTECTED]  [EMAIL PROTECTED]
> 
> Please do not reply off-list
> 
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390


----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to