Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Odd job-reporting buglet (Re: Change in suspend behavior)



On May 10,  3:35pm, Bart Schaefer wrote:
}
} 	for i in bar foo; do mycmd $i & done; wait; fg
} 
} The "wait" is just there to be sure that all the jobs have a chance to
} start up (and then stop again on SIGTTOU or SIGTTIN) before the "fg"
} is executed.

Change that loop just a little bit and some really strange things happen:

schaefer[501] for i in bar foo; do cat & wait; done
[2] 27451
[2]  + suspended (tty input)  cat
[1] 27452
[1]  + suspended (tty input)  cat
zsh: suspended (tty input)  cat | 
zsh: running                for i in bar foo; do; cat & wait; done

Eh?  It thinks "cat" has been piped to the for loop!  Also, how did job
number 2 get a smaller process ID than job number 1?

schaefer[502] jobs -l
[1]  + 27452 suspended (tty input)  cat | 
       27453 running                for i in bar foo; do; cat & wait; done
[2]  - 27451 suspended (tty input)  cat

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author