Re: script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Thanks all

On 10/1/08, Chris Geldenhuis <chris.gelden@xxxxxxxxxxx> wrote:
>
> MHR wrote:
>
> > On Tue, Sep 30, 2008 at 3:08 PM, Chris Geldenhuis
> > <chris.gelden@xxxxxxxxxxx> wrote:
> >
> >
> > > How about:
> > >
> > > find <startdir> -exec sed "s/10.5.1.10/127.128.1.10/" \{\} \;
> > >
> > >
> > >
> >
> > First, the '\' characters are unnecessary and confusing, except the
> > one that precedes the semi-colon.
> >
> > Second, that won't work.  Sed does not perform on files in place - its
> > output is sent to stdout unless it is redirected, and you can't
> > redirect it back to the original file.  To do something this way,
> > you'd need a script that replaced the input file and used 'sed' to
> > generate the new one (and then the script would have to rename it).
> >
> > mhr
> > _______________________________________________
> > CentOS mailing list
> > CentOS@xxxxxxxxxx
> > http://lists.centos.org/mailman/listinfo/centos
> >
> >
> >
> Apologies I should have included the -i switch for sed to modify file in place.
>
> ChrisG
>
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> http://lists.centos.org/mailman/listinfo/centos
>
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux