kill command issues


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting kill command issues
# 1  
Old 03-18-2009
kill command issues

xxxxxx

Last edited by kitty123; 03-19-2009 at 12:10 AM.. Reason: added code tags for better reading
# 2  
Old 03-18-2009
should it be $5 or $$ on line 7?
# 3  
Old 03-18-2009
when i put $$ it runs the first loop but then it kills the 2nd loop completely and doesn't pass the PID number into the second loop.

i also tried $1 and it gave me this error

kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]
process is terminating process
# 4  
Old 03-18-2009
but $5 is the fifth argument on the commandline... so what is $5?
# 5  
Old 03-18-2009
well im not entering anything on the command line. when i run the script i just want it to print off the PID # in the first loop and then recycle those numbers to the second loop and then kill the process. so $5 is definetley not correct. I would think it would be $$ too for the PID but it kills the 2nd loop completely. i want to see the 2nd loop terminating the process in the loop and then repeat the PID #.
# 6  
Old 03-18-2009
i don't understand what you are trying to do... maybe one of our scripting gurus does Smilie. i'm going off to sleep now. hard day ahead!

btw. welcome to unix.com
# 7  
Old 03-18-2009
it has to be $$ but then i think there is something wrong in the kill line thats not making the 2nd loop recycle the PID #'s. is there something else other than -9 that can be used be/c when i put in $$ it just says "killed" in the second loop and it doesn't even run.


i want the first loop to list out the PID # five times

then the second loop i want it to list out the PID # that was listed in the first loop (again 5 times) but kill them when it lists them out.

Last edited by kitty123; 03-18-2009 at 08:19 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Kill command

what is the difference between kill 5 and kill %5? the first one is to kill a process with PID 5 but what does the % mean in the second one? (3 Replies)
Discussion started by: chinababy
3 Replies

2. Shell Programming and Scripting

kill using the ps command

hello, can anyone help me with a script that checks the status of processes and "kills" the process that's hanging? I mean I'm aware of the commands but I'm confused on how to put them all together... thanks! :) (4 Replies)
Discussion started by: dude911
4 Replies

3. Shell Programming and Scripting

kill command

Good way to kill the process, if the process having it's child (3 Replies)
Discussion started by: pritish.sas
3 Replies

4. Solaris

Help with Kill Command

I am running Solaris 9. I have a problem with kill command. I'm sort of teaching myself so this might be a really stupid thing. I logged in as a normal user, lets say ABC, and then did "su" to root. After becoming root, I tried to kill the process started by ABC by saying kill -9 "pid of ABC" ... (3 Replies)
Discussion started by: the_red_dove
3 Replies

5. Shell Programming and Scripting

understanding the kill command

Hi Guys, I like to know if i have a process which triggers 10 different child processes. How to identify out of the 11 processes running which is the parent process and what are the child process? And if i kill the parent process will the child process be killed.. if not is there a way to... (2 Replies)
Discussion started by: mac4rfree
2 Replies

6. Linux

Kill a process without using kill command

I want to Kill a process without using kill command as i don't have privileges to kill the process. I know the pid and i am using Linux 2.6.9 OS. (6 Replies)
Discussion started by: sudhamacs
6 Replies

7. Shell Programming and Scripting

Kill a process without using kill command

Sorry, posted the question in other forum. (0 Replies)
Discussion started by: sudhamacs
0 Replies

8. UNIX for Dummies Questions & Answers

Kill Command

Hi All, What is difference between kill & kill -9 command? Thanks & regards, Sonali (4 Replies)
Discussion started by: sonali
4 Replies

9. Programming

the kill command

is it possible to implement the kill command using C? (2 Replies)
Discussion started by: kelogs1347
2 Replies

10. UNIX for Dummies Questions & Answers

kill command

what is the kill command? (1 Reply)
Discussion started by: Rush
1 Replies
Login or Register to Ask a Question