🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #921

Re: odd `shift' behaviour with bash-1.12

#921
From: Robert Elz
Date: Sat, 29 Aug 1992 17:05
15 lines
1112 bytes
In <SPA.92Aug27153635@khore-dump.fct.unl.pt>
spa@fct.unl.PT (Salvador Pinto Abreu) writes:

| The scope of the `shift' command seems to be the innermost loop. For
| example, the following code:

Take away the "| cat" which takes the output from your inner loop,
and try it then (though your output will no longer be buffered by cat).

Its SOP for shells that when a control statement has I/O redirected
the control statement is run in a sub-shell, and so can't affect anything
in the environment of the real shell (including $# etc).  Just why it
has to be that way has never been clear to me, but that's the way it is.

kre
Technical Details
Message-ID: <9224303.18766@mulga.cs.mu.OZ.AU>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.mu.oz.AU!kre
References: <SPA.92Aug27153635@khore-dump.fct.unl.pt>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.bash.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cs.mu.oz.AU!kre
From: kre@cs.mu.oz.AU (Robert Elz)
Subject: Re: odd `shift' behaviour with bash-1.12
Message-ID: <9224303.18766@mulga.cs.mu.OZ.AU>
Sender: gnulists@ai.mit.edu
Organization: Computer Science, University of Melbourne, Australia
References: <SPA.92Aug27153635@khore-dump.fct.unl.pt>
Distribution: gnu
Date: Sat, 29 Aug 1992 17:05:46 GMT
Approved: bug-bash@prep.ai.mit.edu
Lines: 16