[CentOS] sed append question

Filipe Brandenburger filbranden at gmail.com
Wed Aug 19 20:39:42 UTC 2009


On Wed, Aug 19, 2009 at 16:20, Joseph L.
Casale<JCasale at activenetwerx.com> wrote:
> '/string/a \\tstuff\t\t\tmorestuff' != "/string/a \\tstuff\t\t\tmorestuff"

Yes, indeed... The rules of quoting and backslashes in the shell are
not very uniform and can get quite tricky... Also, the \t is
interpreted by sed, and AFAIK it is available in GNU sed only, so the
syntax you are using above might not be very portable to other
versions of "sed". If your script gets this tricky it's probably time
to move to Perl, which can also do that easily in an one-liner and, in
this case, might actually be more portable. (Heck, it might even be
more readable!)


More information about the CentOS mailing list