baslinux AT lists.ibiblio.org
Subject: Baslinux mailing list
List archive
[BL] USING SED TO SUBSTITUTE: was Re: bash help; changing case of file names, hyperlinks
- From: sindi keesan <keesan AT sdf.lonestar.org>
- To: baslinux AT lists.ibiblio.org
- Subject: [BL] USING SED TO SUBSTITUTE: was Re: bash help; changing case of file names, hyperlinks
- Date: Sun, 25 Feb 2007 05:23:54 +0000 (UTC)
I made a testfile containing hello.
cat testfile | sed -e "/hello/bye/" > testfile2
I get the same file copied, with hello not bye.
I tried with and without -e and " "
cat testfile | sed /hello/goodbye/ > testfile3
sed: Unsupported command o
I get an empty file.
cat testfile | sed /hello/gbye > testfile4
sed: Can't find label for jump to `ye'
Where did I go wrong?
Sindi
man sed
Searched on substitute and found
[addr2]s/re/replacement/flags
and made a lucky guess at the meaning of it.
cat testfile | sed "s/hello/goodbye/" > testfile2 worked as expected.
You cannot add or subtract slashes but " " is optional here
s is for substitute, and without it the g and b in previous tests are misinterpreted?
Thanks to all for the script.
Sindi
-
[BL] bash help; changing case of file names, hyperlinks,
James Miller, 02/23/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
sindi keesan, 02/23/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
3aoo-cvfd, 02/23/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
sindi keesan, 02/24/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
3aoo-cvfd, 02/24/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
sindi keesan, 02/24/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
3aoo-cvfd, 02/24/2007
- Re: [BL] bash help; changing case of file names, hyperlinks, sindi keesan, 02/25/2007
- [BL] USING SED TO SUBSTITUTE: was Re: bash help; changing case of file names, hyperlinks, sindi keesan, 02/25/2007
- Re: [BL] USING SED TO SUBSTITUTE: was Re: bash help; changing case of file names, hyperlinks, Lee Forrest, 02/25/2007
- Re: [BL] bash help; changing case of file names, hyperlinks, 3aoo-cvfd, 02/25/2007
- Re: [BL] bash help; changing case of file names, hyperlinks, sindi keesan, 02/25/2007
- Re: [BL] bash help; changing case of file names, hyperlinks, Karolis Lyvens, 02/25/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
3aoo-cvfd, 02/24/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
sindi keesan, 02/24/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
3aoo-cvfd, 02/24/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
sindi keesan, 02/24/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
3aoo-cvfd, 02/23/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
sindi keesan, 02/23/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
Karolis Lyvens, 02/24/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
sindi keesan, 02/24/2007
- [BL] Scripts Using Sed (was: bash help; changing case of file names, hyperlinks) 56, Lee Forrest, 02/24/2007
-
Re: [BL] bash help; changing case of file names, hyperlinks,
sindi keesan, 02/24/2007
- Re: [BL] bash help; changing case of file names, hyperlinks -- corrections, Lee Forrest, 02/24/2007
Archive powered by MHonArc 2.6.24.