capturing the most recent pid from csh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting capturing the most recent pid from csh
# 1  
Old 10-17-2008
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?

Last edited by scottwevans; 10-17-2008 at 02:03 AM..
# 2  
Old 10-17-2008
Hmm... shouldn't you be converting the other way? :-)

You could pull it out of the jobs -l output... not as convenient, but...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Recent History

Could some let me know the command used to view the commands that I have entered 2 days ago. I am able to perform a command fc -l but its yielding me only last 10 recent events. I need to know the history of the commands that i have entered 2 days ago. Is there anyway that I can get the information... (5 Replies)
Discussion started by: bobby1015
5 Replies

2. Shell Programming and Scripting

Getting the most recent file

Hi people, Please some help over here. I have logs in a directory, in which I need to get the most recent file in order to put it within other command. The format of the files are loadfiles20090308094339_41 loadfiles20090308094418_42 loadfiles20090308095457_43... (4 Replies)
Discussion started by: cgkmal
4 Replies

3. UNIX for Advanced & Expert Users

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? (1 Reply)
Discussion started by: scottwevans
1 Replies

4. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

5. Shell Programming and Scripting

csh failing to call an 2 embedded csh script

I have an extraordinary problem with a csh script.....(feel free to berate the use of this but I'm modifying an existing bunch of them) Anyway, I have a master csh script which in turn calls a second csh script. This second csh script is below. Within this second script are two compiled C++... (1 Reply)
Discussion started by: pollsizer
1 Replies

6. Shell Programming and Scripting

To keep only the most recent files

Hi all, I'm running on a Sun Solaris machine. I would only want to keep the last 2 most recent files on 1 of my directory. Below shows my script, but it is incomplete. For the ?? part I do not know how to continue. please help:confused: DIR=/tmp/abc OUTPUT=/tmp/output.out... (1 Reply)
Discussion started by: *Jess*
1 Replies

7. Shell Programming and Scripting

getting Ambiguous error on kill -9 @pid from csh

Hello all i have simple script that executing program every 10 seconds im invoke this script as daemon with second script that put it in the background this is my first script (IsAliveTester.csh) #!/bin/csh -f @ iSleep = 10 set processName = "ClientTester" while(1) $processName ... (0 Replies)
Discussion started by: umen
0 Replies

8. Shell Programming and Scripting

getting the most recent file

Hi, I have files coming in every day with that days timestamp like: nameyyyymmddhhmmss.ext. I need the most recent one and so i am using cat `ls -t name*|head -1 ` > temp i am sorting the files in the decending order and am copying the most recent one into a temp file. It works at times... (3 Replies)
Discussion started by: anujairaj
3 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. Programming

printing ppid,child pid,pid

question: for the below program i just printed the value for pid, child pid and parent pid why does it give me 6 values? i assume ppid is 28086 but can't figure out why there are 5 values printed instead of just two! can someone comment on that! #include<stdio.h> #define DIM 8 int... (3 Replies)
Discussion started by: a25khan
3 Replies
Login or Register to Ask a Question