test a sed command?

Dazed_75 lthielster at gmail.com
Wed Sep 14 11:41:48 MST 2011


Thank you all.  Apparently I was not clear that I was talking about doing
this for a number of files and in potentially several directories in a
hierarchy.  Since sed seems also to have no recursive directory option
either, it seems I have to just know which direcories have eligable files in
them and do it a directory at a time.  I was trying to avoid copying all the
material to a test directory, but that seemed the best course.  Putting
Joseph's solution and Kevin's suggestion together with globbed file names
for a test showed me I would feel pretty safe even doing this in the live
directories since the substitution is of IP addresses which are very
definitive in form.

Thanks again!

On Tue, Sep 13, 2011 at 10:06 PM, Kevin Fries <kfries6 at gmail.com> wrote:

> -i.bak (no space) to keep a backup of the original in case you need to
> revert the changes.
>
> Kevin
> On Sep 13, 2011 10:00 PM, "Dazed_75" <lthielster at gmail.com> wrote:
> > How do people test sed replacements on something consequential? I thought
> I
> > remembered sed having an option to just report what changes it WOULD HAVE
> > made without actually making the changes. But I can't find anything like
> > that.
> >
> > Best I can think of is to make a test directory [hierarchy], copy your
> files
> > into it, run the sed command and then look at all the files for intended
> and
> > unintended changes (or diff them from the originals). That would seem to
> > suck!
> >
> > --
> > Dazed_75 a.k.a. Larry
> >
> > The spirit of resistance to government is so valuable on certain
> occasions,
> > that I wish it always to be kept alive.
> > - Thomas Jefferson
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>



-- 
Dazed_75 a.k.a. Larry

The spirit of resistance to government is so valuable on certain occasions,
that I wish it always to be kept alive.
  - Thomas Jefferson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20110914/99851249/attachment.html>


More information about the PLUG-discuss mailing list