2017-06-06 23:04:43 +0200, Jilles Tjoelker: [...] > > Yes, you're right, it looks like the "-" in: > > > sh +u-e > > > is just ignored (or everything is ignored for all I can tell > > with testing as there's nothing that can be turned off here). > > > More generally, given that there's no option enabled by default, > > it looks like "sh +anything" is pointless, which is why I said > > above "not sure why as it doesn't seem any option ever gets > > enabled by default, so there should be any need to turn them off > > on startup". Again, I suppose it's just because it shares the > > same code as "set". > > In interactive mode, job control (-m) is enabled automatically. Some > shells, such as FreeBSD sh, dash, mksh and heirloom-sh-050706, allow > starting an interactive shell without job control using sh +m, while > other shells, such as bash and ksh93, do not (the option is ignored). > > I use this feature in the FreeBSD sh testsuite to test interactive > features without needing to set up a tty. > > Disabling job control as the first command is not a suitable > alternative, since the harmful effects of a missing or improper tty > (warning messages and stop signals) occur before the first command. [...]
True of POSIX shells, but that part of the discussion was about the Bourne shell where, in those versions where it was available, the -m option was not enabled by default. In POSIX shells, having sh +option can make sense for that -m indeed but also because those shells accept more than one option argument, so one can do: sh -x +x ... -- Stephane