Article View: gnu.bash.bug
Article #1079Re: putting multiple cmds in bg using &
From: News system owner ID
Date: Thu, 21 Dec 1989 17:21
Date: Thu, 21 Dec 1989 17:21
44 lines
2370 bytes
2370 bytes
pwolfe@kailand.kai.com (Patrick Wolfe) writes:
< I've found something that acts different in Bash than in Csh (the shell I
< previously used). To place a multiple command list in the background, it is
< neccessary to use parens to enclose the command. For example:
<
< date ; make ; date &
<
< with Bourne Shell or Bash 1.04, runs the first two commands in the foreground
< and the last in the background, where C shell will create a background job
< which runs all three commands.
I'll have to re-read the csh man page, but at a glance I *swear* this
is a csh misfeature (aka. deliberate bug). The csh man page is vague.
From csh(1):
Pipelines can be separated by semicolons (;), in which case
they are executed sequentially. Pipelines that are separated
by && or || form conditional sequences in which the execu-
tion of pipelines on the right depends upon the success or
failure, respectively, of the pipeline on the left.
[The way I read the above, "foo && bar" is a (conditional) sequence,
but "foo; bar" may or may not be an unconditional sequence.]
A pipeline or sequence can be enclosed within parentheses `(
)' to form a simple command that can be a component in a
pipeline or sequence.
A sequence of pipelines can be executed asynchronously, or
in the background by appending an `&'; rather than waiting
for the sequence to finish before issuing a prompt, the
shell displays the job number (see Job Control, below) and
associated process IDs, and prompts immediately.
Anyway, in every other shell I've ever heard of ; and & are at the
same precedence level. It's easier to remember, and more intuitive.
Please let's keep bash the way it is, and force people to do
(foo; bar) &
like they should have been doing in the first place.
-- Paul Placeway
Technical Details
Message-ID:
<50009@bbn.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!think!bbn!newsReferences:
<8912121932.AA20899@kailand.kai.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!think!bbn!news From: news@bbn.COM (News system owner ID) Newsgroups: gnu.bash.bug Subject: Re: putting multiple cmds in bg using & Message-ID: <50009@bbn.COM> Date: 21 Dec 89 17:21:31 GMT References: <8912121932.AA20899@kailand.kai.com> Reply-To: pplacewa@antares.bbn.com (Paul W Placeway) Distribution: gnu Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 44