bug-bash
[Top][All Lists]
Advanced

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

Re: while loop with extdebug + debug trap always returning 1


From: Martijn Dekker
Subject: Re: while loop with extdebug + debug trap always returning 1
Date: Tue, 4 Apr 2017 17:57:20 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Op 04-04-17 om 11:41 schreef nesro:
> # run an empty for cycle. we can see from the output that bash ran :, then
> # false and stopped to it. which is the right behavior
> for (( :; false; )); do :; done

This is a syntax error. 'for' takes arithmetic expressions, not shell
commands.

> # now run this while cycle. it just cycle the debug trap forever
> while false; do :; done

The 'false' command is never executed so never has the chance to return
an exit status of "false" (1).

- M.




reply via email to

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