DASH Shell discussions
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Adam Kellas <Adam.Kellas@gmail.com>
Cc: dash@vger.kernel.org
Subject: Re: dash -n and -v not implemented?
Date: Mon, 23 Aug 2010 14:22:39 -0600	[thread overview]
Message-ID: <4C72D88F.1000502@redhat.com> (raw)
In-Reply-To: <i4uj8q$ah3$1@dough.gmane.org>

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

      reply	other threads:[~2010-08-23 20:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23 19:47 dash -n and -v not implemented? Adam Kellas
2010-08-23 20:22 ` Eric Blake [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C72D88F.1000502@redhat.com \
    --to=eblake@redhat.com \
    --cc=Adam.Kellas@gmail.com \
    --cc=dash@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox