Re: strange result loop exit status

2014-03-19 Thread Dmitry Arkhireev
Thank you, Greg. It turned out I was wrong in the basics. Your explanation made ​​me to review my code. I will be more careful in the future. 19 марта 2014 г., в 18:27, Greg Wooledge написал(а): > On Wed, Mar 19, 2014 at 02:18:52PM +0400, Dmitry Arkhireev wrote: >> And if run it sample with echo

Re: strange result loop exit status

2014-03-19 Thread Greg Wooledge
On Wed, Mar 19, 2014 at 02:18:52PM +0400, Dmitry Arkhireev wrote: > And if run it sample with echo $I after ((I++)) everything works as expected > I=0; while [ $I -ne 1 ]; do ((I++)); echo $I; done; echo $? > 1 > 0 Here, $? is the exit status of the echo, instead of the ((...)) command. The ((...)