caputring most recent pid in c-shell


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users caputring most recent pid in c-shell
# 1  
Old 10-16-2008
caputring most recent pid in c-shell

I'm trying to convert a script from bash to csh. The original script makes use of the $! variable to capture the most recent pid spawned from within the script. Is there an equivalent command or variable in the c-shell to capture the pid?

Last edited by scottwevans; 10-17-2008 at 02:02 AM..
# 2  
Old 10-17-2008
$! is the PID of the most recent backgrounded process in both bash and csh.
MrC
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Having problem with executing shell script to get the pid details!

Hello Everyone, I am new to shell scripting and also i am very new to AIX machine I have a question. I have shell script which contains the follwing "ps -e |grep $1 echo $2" i run this schell script by doing this ./startSehllscript 3444 passed with two parameters . Accroiding my... (4 Replies)
Discussion started by: swati
4 Replies

2. Shell Programming and Scripting

Use cURL in shell script and get most recent file from remote server using SFTP

I have been trying to implement the following shell script -- sftp to remote server get list of files in the directory sftp get the most recent listed file exit This script will be scheduled to be executed everyday using CRON or CONTROL-M and the need is to have absolutely no human... (7 Replies)
Discussion started by: toobrown1
7 Replies

3. Shell Programming and Scripting

shell script for getting pid of spawn processes from shell

Hi, I am new this forum. I request you peoples help in understanding and finding some solution to my problem. Here it goes: I need to perform this set of actions by writing a shell script. I need to read a config file for the bunch of processes to execute. I need to fecth the pid of... (4 Replies)
Discussion started by: sachin4sachi
4 Replies

4. Shell Programming and Scripting

Kron Shell: deleting all but most recent log files

I am trying to create a Korn Shell script to be run every 5-10 minute from a crontab. This script needs to look for log files (transaction_<date>.log). If there are more than 5 such files, it needs to delete all but the most current 5. How often these files are create varies - can be every minute... (2 Replies)
Discussion started by: WmShaw
2 Replies

5. Shell Programming and Scripting

capturing the most recent pid from csh

I'm trying to convert a script from bash to csh. The original script makes use of the $! variable to capture the most recent pid spawned from within the script. Is there an equivalent command or variable in the c-shell to capture the pid? (1 Reply)
Discussion started by: scottwevans
1 Replies

6. Shell Programming and Scripting

parent shell pid

hi folks can any suggest me how to get a parent processid in the script if i am executing this in the script vi myscript.sh echo "parent shell pid"$$ sh myscript.sh but when i am executing this i am getting a new pid(actually that is the child pid) whenever i am executing this... (4 Replies)
Discussion started by: maheshwin
4 Replies

7. Shell Programming and Scripting

Need to know rhe PID for the Shell Script running

I have a Shell Scritp named "Statistics" which has a Infinate Wille Loop Running I want to restart this Srcipt "Statistics" when i try to run other srcipt Ex "ABC" so i want to kill the "Statistics" script in "ABC" so for this I what to know the PID for that Script "Statistics" which is... (7 Replies)
Discussion started by: pbsrinivas
7 Replies

8. Shell Programming and Scripting

caputring information from log

Hello all, I am pretty new and UNIX scripting. I am trying to write a script that will caputure some information from a log, without opening a log. Can you please point me in the right direction. Thanks, Keyur (5 Replies)
Discussion started by: fossil0681
5 Replies

9. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

10. UNIX for Advanced & Expert Users

How can I wait for PID to finish in another shell

Have a need to schedule programs that can run after other programs are completed. Here's the catch: 1) The list of programs will not always be the same (kind of a plug-n-play deal) 2) The invoking shell may not be the same as the shell of the program being waited on In other words, I need... (2 Replies)
Discussion started by: superdelic
2 Replies
Login or Register to Ask a Question