Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to run a processes in the back ground in shell scripting

24 views
Skip to first unread message

amarna...@gmail.com

unread,
Jan 7, 2007, 3:33:29 AM1/7/07
to
can any help me how to run a script in the back ground using shell
scripting

Tintin

unread,
Jan 7, 2007, 4:40:42 AM1/7/07
to

<amarna...@gmail.com> wrote in message
news:1168158809.5...@v33g2000cwv.googlegroups.com...

> can any help me how to run a script in the back ground using shell
> scripting

script &


--
Posted via a free Usenet account from http://www.teranews.com

Tony Lawrence

unread,
Jan 7, 2007, 8:29:23 AM1/7/07
to

Tintin wrote:
> <amarna...@gmail.com> wrote in message
> news:1168158809.5...@v33g2000cwv.googlegroups.com...
> > can any help me how to run a script in the back ground using shell
> > scripting
>
> script &

Correct, and yet it leaves out so much.

There is an awful lot to cover, and some of it is pretty complicated.
The new Unix user actually has a lot to learn about this. There's the
matter of controlling the output, the job priority, and interrupts. For
more complex situations, process groups could be important. Job control
is a whole subject by itself. It gets deep fast.

But to what purpose? Nowadays it is unusual for the average user to
have any need of background processing: we just open another window. If
we need to reduce priority (which is also pretty rare today), we "nice"
the process in that window. Interrupts, process groups, job control:
who cares?

I looked up "background process group" in Stevens "Advanced Programming
in the Unix Environment" and took a trip down memory lane.. I haven't
even thought about most of that
in many years.

Probably only a few people have any need to know anything about this,
and most of those only need it to pass a beginner computer science
course. A very few support people stuck doing support for ancient
systems that only provide modem access may need to remember some of
this now and then, but for the rest of us, it's almost completely dead.

When was the last time you needed shell background processing and why?
I don't even own any modems anymore, but now and then I'll leave
something running with "nohup" on some customer
system.. but since everything runs so fast nowadays, that's pretty
unusual too..


--
Tony Lawrence
Unix/Linux/Mac OS X Resources
http://aplawrence.com

Bruce Barnett

unread,
Jan 7, 2007, 9:34:07 AM1/7/07
to
"Tony Lawrence" <pcu...@gmail.com> writes:

>> > can any help me how to run a script in the back ground using shell
>> > scripting
>>
>> script &
>
> Correct, and yet it leaves out so much.


Well, since the OP asked another question because of a job interview,
it might be a good idea to let them learn it on their own.

> When was the last time you needed shell background processing and why?

All the time. Last time I was trying to find two identical files on a
400GB drive. Or a recursive directory comparison going to a file.
Or a "du | dusort >/tmp/dusort".

Or I just want the output to go to a file while I'm doing something
else. Why wait 3 seconds?


--
Sending unsolicited commercial e-mail to this account incurs a fee of
$500 per message, and acknowledges the legality of this contract.

Martijn Lievaart

unread,
Jan 7, 2007, 1:56:21 PM1/7/07
to
On Sun, 07 Jan 2007 05:29:23 -0800, Tony Lawrence wrote:

> When was the last time you needed shell background processing and why?

Oh, lots of times, but see below.

> I don't even own any modems anymore, but now and then I'll leave
> something running with "nohup" on some customer
> system.. but since everything runs so fast nowadays, that's pretty
> unusual too..

I just use screen whenever I can. Much nicer. That way I can just open
another window or detach when stuf takes (to) long.

M4
--
Ah, the beauty of OSS. Hundreds of volunteers worldwide volunteering
their time inventing and implementing new, exciting ways for software
to suck. -- Toni Lassila in the Monastry

Tony Lawrence

unread,
Jan 7, 2007, 2:30:27 PM1/7/07
to

Bruce Barnett wrote:
> "Tony Lawrence" <pcu...@gmail.com> writes:

> > When was the last time you needed shell background processing and why?

> Or I just want the output to go to a file while I'm doing something
> else. Why wait 3 seconds?

Right.. that's so automatic I don't even notice :-)

0 new messages