[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] How to exit with a given exit code in END?
From: |
arnold |
Subject: |
Re: [bug-gawk] How to exit with a given exit code in END? |
Date: |
Tue, 09 May 2017 08:26:53 -0600 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
Peng Yu <address@hidden> wrote:
> Hi,
>
> The following code will not finish. Is there a way to control the exit
> status code in END {}? Thanks.
>
> awk -e 'END { exit 1 }'
>
> --
> Regards,
> Peng
Hi. Please Read The Fine Manual.
In a case where there is only an END rule, all the input is read, and
then the END rule executes:
$ gawk 'END { exit 1 }'
^D
$ echo $?
1
Arnold