baslinux AT lists.ibiblio.org
Subject: Baslinux mailing list
List archive
[BL] Scripts Using Sed (was: bash help; changing case of file names, hyperlinks) 56
- From: Lee Forrest <lforrestster AT gmail.com>
- To: baslinux AT lists.ibiblio.org
- Subject: [BL] Scripts Using Sed (was: bash help; changing case of file names, hyperlinks) 56
- Date: Sat, 24 Feb 2007 18:19:59 +0000
On Sat, Feb 24, 2007 at 11:53:37PM +0000, sindi keesan wrote:
[delete]
> I can also use $USER instead of `whoami`.
> Is the following correct?
>
> cat ~keesan/procmailrc.sample | sed -e "/keesan/$USER/g" >> ~/.procmailrc
The "-e" isn't necessary unless there is more than one expression:
sed -e 's/A/a/' -e 's/b/B/' # for example
You can also do that like so:
sed 's/A/a/;s/b/B/'
(There are many versions of sed, so watch out for exceptions to the above.)
Usually, to be on the safe side, when a variable is bounded by
something other than spaces or newlines, you should enclose it in
double quotes or like this: ${USER}
> There is only one occurrence of keesan. Do I need the g?
No. Your instincts are right on there. That means "global" and is necessary
only if there might be more than one instance on a _line_.
[delete]
>> Because of things like that, I think, Slackware and Linux kernel projects
>> are living for so long and still are actively maintained/developed -
>> they both have "benevolent dictators" that prevent such quarrels.
> So does BL, fortunately.
I couldn't agree more.
Lee
--
BasicLinux: Small is Beautiful
http://www.basiclinux.com.ru
-
Re: [BL] bash help; changing case of file names, hyperlinks
, (continued)
-
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,
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 -- corrections, Lee Forrest, 02/24/2007
Archive powered by MHonArc 2.6.24.