[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: What should we do with the -n flag in sh ?
On Fri, Feb 26, 2016 at 08:50:27AM +0700, Robert Elz wrote:
> But dealing with -I wasn't really the question, I'd appreciate opinions
> on handling -n though (not so much in interactive shells, David Holland's
> suggestion seems fine for that, and entirely reasonable) - but for
> non-interactive shells (scripts that set -n in weird places, rather than
> ones invoked as "sh -n script" which are easy to deal with.)
I'm not sure that supporting 'set -n' is a good idea.
Certainly it's use (to exit a shell script from inside some inner
construct) seems somewhat dangerous and non-portable.
However 'sh -n script', 'set -n; . script' and 'set -n; long_command'
might all be reasonable from an interactive shell.
I wonder if '-n' was added to support 'make -n'?
So make issued 'sh -cn "commands"' ??
That might actually be useful!
Unsetting '-n' when outputting the prompt does sound reasonable.
David Laight: david%l8s.co.uk@localhost
Main Index |
Thread Index |