DASH Shell discussions
 help / color / mirror / Atom feed
* dash -n and -v not implemented?
@ 2010-08-23 19:47 Adam Kellas
  2010-08-23 20:22 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Kellas @ 2010-08-23 19:47 UTC (permalink / raw)
  To: dash

Am I missing something, or do the -n and -v flags have no effect? The 
following compares the behavior of bash, ksh, and dash (bash requires an 
extra flag to suppress startup files):

% ksh -v -n -c uname
uname

% bash --norc -v -n uname
uname

% dash -v -n -c uname
Linux

AK



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: dash -n and -v not implemented?
  2010-08-23 19:47 dash -n and -v not implemented? Adam Kellas
@ 2010-08-23 20:22 ` Eric Blake
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2010-08-23 20:22 UTC (permalink / raw)
  To: Adam Kellas; +Cc: dash

On 08/23/2010 01:47 PM, Adam Kellas wrote:
> Am I missing something, or do the -n and -v flags have no effect? The
> following compares the behavior of bash, ksh, and dash (bash requires an
> extra flag to suppress startup files):
>
> % ksh -v -n -c uname
> uname
>
> % bash --norc -v -n uname
> uname
>
> % dash -v -n -c uname
> Linux

POSIX states that an interactive shell may ignore 'set -n'; and by 
extension, 'sh -n' can be a no-op if the shell would otherwise be 
interactive.  But your example is not an interactive shell; and POSIX is 
clear that both -v and -n must have the same effect as an option to the 
shell command line as they would have to a use of set within the shell.

I think the absence of handling for both of these options is a definite 
bug according to POSIX rules on sh.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-23 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-23 19:47 dash -n and -v not implemented? Adam Kellas
2010-08-23 20:22 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox