Re: how to use sed

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

 



On Wed, Feb 09, 2005 at 12:58:52AM -0600, Thomas Cameron wrote:
> Using sed (clunky):
> 
> [thomas.cameron@mail ~]$ cat foo
> #!/usr/bonsaitools/bin/perl
> [thomas.cameron@mail ~]$ sed "s/\/bonsaitools//" foo
> #!/usr/bin/perl
> [thomas.cameron@mail ~]$ sed "s/\/bonsaitools//" foo > zzz
> [thomas.cameron@mail ~]$ mv zzz foo
> [thomas.cameron@mail ~]$ cat foo
> #!/usr/bin/perl
> 
> Using perl (better):
> 
> [thomas.cameron@mail ~]$ cat foo
> #!/usr/bonsaitools/bin/perl
> [thomas.cameron@mail ~]$ perl -pi -e 's/\/bonsaitools//' foo
> [thomas.cameron@mail ~]$ cat foo
> #!/usr/bin/perl

Or using sed (better):

sed -ie s,/bonsaitools,, foo

	Jakub


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux