>> See regex(7) for more info.

Thanks for the pointer and the explanation.  That actually pointed me to
another solution...

                sed 's/[$]//g'

...which is much easier to read, and in very crude time tests is about
equivalent to "s/\\\\$//g".

bd

===========================
Brad Doster
Insight Network Solutions
www.InsightNetSolutions.net
925.335.9510


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Luke C Gavel
Sent: Friday, January 26, 2001 2:18 AM
To: [EMAIL PROTECTED]
Subject: RE: Bash Script Questions


On Thu, 25 Jan 2001, Brad Doster wrote:

> But why?  Why doesn't good ol' '\$' work right out of the
> box?

Because the '$' is used in a special by the shell (script) and
sed too.  sed uses the '$' to anchor a search pattern from the
end of a line, and, of course the script uses it to expand
variables' values.  This particular symbol has to be extrapolated
above all of these nested mechanisms.  See regex(7) for more
info.


Now, technically, sed shouldn't try to use the '$' if it isn't at
the end of the regular expression a.k.a. your search pattern
string.  However, who says that *any* software is fully
POSIX-compliant to 100%?  In other words, theoretical standards
for software interfaces work better on the drawing board than in
practice.  That's life.

HTH,
LG



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to