[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
forcing true to return false [was: Wishing rmdir had a prompt]
From: |
Bernhard Voelker |
Subject: |
forcing true to return false [was: Wishing rmdir had a prompt] |
Date: |
Thu, 24 Oct 2019 08:46:45 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 |
On 2019-10-23 19:22, address@hidden wrote:
> On 2019-09-02 17:22, Bernhard Voelker wrote:
>> Just recently I've been asked (off-list) why src/true.c needs to have
>> 80+ lines while 3 lines would be enough.
>
> This piqued my curiosity. Obvious comment header, localization, and
> --{help,version} fluff aside, I was not aware of the GNU-specific fringe
> case, outlined on the info page as steps to force true to produce a false
> return value. It has been added to my list of party gags.
You probably mean this case?
$ env true --version >/dev/full ; echo $?
true: write error: No space left on device
1
Well, that's for programming safety and - after all - consistency among
the GNU tools.
Have a nice day,
Berny