Subject: Re: shift: can't shift that many
From: Bob McGowan <[email-masked]>
To: Dan Holmsand <[email-masked]>
Cc: Cygwin mailing list <[email-masked]>, [email-masked]
Date: Tue, 13 Jun 2000 12:14:38 -0700

Dan Holmsand wrote:
> 
> Actually, I think cygwin's sh is quite right - xemacs' installexe.sh tries
> to shift three args where there's only two. Changing "shift 2" to just
> "shift" in line 12 gets rid of the error message.
> 
> /dan
> 
> > -----Original Message-----
> > From: [email-masked] [mailto:[email-masked]]On
> > Behalf Of John A. Turner
> > Sent: den 13 juni 2000 14:03
> > To: XEmacs on NT; Cygwin mailing list; [email-masked]
> > Subject: Re: shift: can't shift that many
> >
> >
> > "John A. Turner" wrote:
> > >
> > > I've successfully built a cygwin version of XEmacs 21.2.34
> > >
> > > however, during make install, I get lots of msgs from bash related
> > > to the shift built-in - as in the subject:
> > >
> > > shift: can't shift that many
> >
> > never mind - I can't believe this, but I've been bitten by the
> > "sh is really ash" feature in cygwin
> >
> > I've been using cygwin long enough to know better, but somehow
> > after an update I forgot to fix that
> >

The following script:

  echo $#
  shift 3
  echo $#
  echo shifting two more:
  shift 2
  echo $#

Produces the following output for sh (ash) and bash:

  $ sh shiftest a b c d
  4
  1
  shifting two more:
  shift: can't shift that many
  1

  $ bash shiftest a b c d
  4
  1
  shifting two more:
  1

The only difference is the error message generated by ash.  The final
result is the same, the last shift did not change the argument count.

I don't think this is a bug in either of shells, unless you want to
count not printing an error as the bug.  It is a bug in the original
script, however.

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
[email-masked]

--
Want to unsubscribe from this list?
Send a message to [email-masked]