bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: gawk "\\" "(" strange behavior ...


From: Stepan Kasal
Subject: Re: gawk "\\" "(" strange behavior ...
Date: Tue, 7 Sep 2004 09:48:18 +0200
User-agent: Mutt/1.4.1i

Hello,

On Tue, Sep 07, 2004 at 11:50:22AM +0800, Jeff Chua wrote:
> Can someone please explain why I've to use /\\/ instead of "\\"
> [...]
> this works ...
> echo "\\" | awk '{print $0; gsub(/\\/, "b"); print $0;}'
> this doesn't ...
> echo "\\" | awk '{print $0; gsub("\\", "b"); print $0;}'

in short, use the first variant, unless you have special needs.
The parameter is a regex, not a string.

See

http://www.gnu.org/software/gawk/manual/html_node/Computed-Regexps.html
(also available as
        info '(gawk)Computed Regexps'
on every fine computer)

for a detailed explanation.

Have a nice day,
        Stepan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]