bug-gawk
[Top][All Lists]
Advanced

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

Re: 'FS' and 'IGNORECASE' example in chapter 4.5.6 produces syntax error


From: arnold
Subject: Re: 'FS' and 'IGNORECASE' example in chapter 4.5.6 produces syntax error
Date: Tue, 22 Dec 2020 07:12:18 -0700
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

The bit you've quoted is a code fragment; the manual doesn't always
show complete programs.  Something like:

        BEGIN {
                FS = "c"
                IGNORECASE = 1
                $0 = "aCa"
                print $1
        }

should work.

Thanks,

Arnold

Arkadiusz Drabczyk <arkadiusz@drabczyk.org> wrote:

> $ cat ./ignorecase.awk
> #!/usr/bin/awk -f
>
> FS = "c"
> IGNORECASE = 1
> $0 = "aCa"
> print $1
> $ ./ignorecase.awk
> awk: ./ignorecase.awk:6: print $1
> awk: ./ignorecase.awk:6: ^ syntax error
>
> Shouldn't it be:
>
> #!/usr/bin/awk -f
>
> FS = "c"
> IGNORECASE = 1
> $0 = "aCa"
> { print $1 }
>
> ?
>
> -- 
> Arkadiusz Drabczyk <arkadiusz@drabczyk.org>



reply via email to

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