The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Print Full record and substring in that record ukatru UNIX for Advanced & Expert Users 1 09-19-2008 07:32 PM
how to read record by record from a file in unix raoscb UNIX for Dummies Questions & Answers 1 05-16-2008 07:30 AM
Launching Several Shells.... marconi Shell Programming and Scripting 1 03-05-2008 07:24 PM
splitting a record and adding a record to a file rsolap Shell Programming and Scripting 1 08-13-2007 02:58 PM
Launching a new bash shell gsd Shell Programming and Scripting 3 07-20-2006 05:30 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 3 Weeks Ago
yankee428 yankee428 is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 29
Record PID when launching

I would like to record the PID of a process when i lauch it from my script

something like:

#/bin/bash
$abc_pid = /apps/abc/abc.bin -port6700

I know I can run the ps command and grep for abc.bin. The idea is that becase the process runs on several ports and the argument list of .bin is quite large, it would be easier if I could capture the PID at run time.

I've tried $abc_pid = $! but this does not work. Also, I've read that sometimes that can give a forked PID instead of the parent.


Thanks,
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:56 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0