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

non-interactive set -m



As far as I can tell, POSIX requires 'set -m' to work even in non-interactive 
shells, if the shell implements the User Portability Utilities (UP) option.  
POSIX is also explicit that 'set -b' shall default to disabled.  Therefore, I 
claim that this demonstrates two bugs:

$ zsh -c 'emulate sh; echo $-; set -m && set +m'
b
zsh:set:1: can't change option: -m
$ echo 1

Of course, being a non-interactive environment, there are no prompts printed, 
so the rules about 'set -m' printing status changes prior to a prompt are 
ignored; and since 'set -b' should be disabled, no asynchronous status messages 
would be printed either.  But the important part is that 'set -m' also controls 
the fact that background jobs are created in their own process group, which IS 
something that a non-interactive script can usefully exploit.  Besides, POSIX 
is eplicit that jobs also work even when 'set +m' is in effect. 

Autoconf would LOVE to implement parallel testsuite support, but supporting 
clean signal-based testsuite abortion at the parent level without leaving hung 
children and without tickling fork bomb bugs in various ksh clones requires the 
use of job control in a non-interactive environment.  Thus, at the moment, bash 
appears to be the only shell capable of reliably running a parallel testsuite:
http://thread.gmane.org/gmane.comp.sysutils.autoconf.bugs/6776

-- 
Eric Blake




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