DASH Shell discussions
 help / color / mirror / Atom feed
From: Guido Berhoerster <gber@opensuse.org>
To: Dan Muresan <danmbox@gmail.com>
Cc: dash@vger.kernel.org
Subject: Re: shift "fatal error"
Date: Thu, 10 Mar 2011 20:23:33 +0100	[thread overview]
Message-ID: <20110310192333.GE3948@wopr.local.invalid> (raw)
In-Reply-To: <AANLkTik1TC3jv-imnbChRGqtHzRCvKCcB5_LnqEnDc9u@mail.gmail.com>

* Dan Muresan <danmbox@gmail.com> [2011-03-10 19:41]:
> Hi, is there some consensus on whether shift should cause a "fatal
> error" as reported by Herbert against bash:
> 
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=252378
> 
> # doesn't print anything
> dash -c 'shift 2; echo hi'
> 
> My copy of SUSv3 doesn't seem to imply any "fatal error" handling
> requirement for shift:
> 
> --- 8-X ---
> EXIT STATUS
> 
> The exit status is >0 if n>$#; otherwise, it is zero.
> 
> CONSEQUENCES OF ERRORS
> 
> Default.
> --- 8-X ---

For IEEE Std 1003.1-2008 see section 2.8.1 "Consequences of
Shell Errors": a "utility syntax error (option or operand error)"
with special built-ins shall cause the shell to exit. That's what
dash, ksh93, and pdksh do.

-- 
Guido Berhoerster

  reply	other threads:[~2011-03-10 19:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 18:40 shift "fatal error" Dan Muresan
2011-03-10 19:23 ` Guido Berhoerster [this message]
2011-03-15 21:31   ` Jilles Tjoelker
2011-03-26  7:11     ` Dan Muresan
2011-03-26  7:27       ` Jonathan Nieder

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=20110310192333.GE3948@wopr.local.invalid \
    --to=gber@opensuse.org \
    --cc=danmbox@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