The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
finding Background Process Id krk_555 Shell Programming and Scripting 4 10-24-2007 05:34 PM
finding idle time of a process Krrishv Shell Programming and Scripting 36 01-10-2007 06:34 AM
finding a process running on a port manduva UNIX for Advanced & Expert Users 8 02-12-2004 03:49 AM
finding process id sskb UNIX for Dummies Questions & Answers 8 04-10-2002 11:00 AM
Finding Out When A Process Has Finished? 1cuervo UNIX for Advanced & Expert Users 5 11-02-2001 02:59 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 04-12-2007
Registered User
 

Join Date: Jan 2005
Posts: 212
Finding out process id in a scipt

Hi,

If in a shell script i write a command

ls > bla &
ls

The output is redirected to bla and the next ls starts as first one is going on in background.

I want to find the PID of the first command.

Thanks in advance
Reply With Quote
Forum Sponsor
  #2  
Old 04-12-2007
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Code:
ls > bla &
echo $!
Cheers
ZB
Reply With Quote
  #3  
Old 04-12-2007
Registered User
 

Join Date: Jan 2005
Posts: 212
Great,

I was looking for just that thing.

Thanks a lot.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0