Killing a shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Killing a shell script
# 8  
Old 08-27-2009
Hi,

I used the kill utility and it seems to work fine for my purposes Smilie

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Killing a program in shell script

I followed the directions here Free Twitter Source Code ? Twitter Database Server: Install and created a php script that enters twitter keyword searches into a MySQL DB. When you execute the files outlined in the above link, a script starts indefinitely. I've noticed that the scripts... (6 Replies)
Discussion started by: phpchick
6 Replies

2. UNIX for Dummies Questions & Answers

Killing the shell Process

I was just playing with the processes and suddenly a question striked my mind: What will happen if we kill directly the shell process?? :rolleyes: Do anyone know? Will the system shutdown? Or the system wont let it be killed? (5 Replies)
Discussion started by: paras.oriental
5 Replies

3. UNIX for Dummies Questions & Answers

Shell Scripts - Killing a job....

Hello all, I need to write a shell script that does the following; Allows you to kill a job,(1) listing only the jobs you own, (2) asks for which job to kill, (3) kills the job and (4) confirms kill... I am not sure if I need to first run the job command and pipe it with kill? Which options... (6 Replies)
Discussion started by: citizencro
6 Replies

4. Shell Programming and Scripting

**need help for killing a process through script**

Hello All, i hope you are fine. I need a little help from you people-- inside a script i want to kill a parent process by checking it with the child process.. p_pid=`ps -e | awk '/ra_cmd_d/ {print$1}'` here i am selecting the child process id in p_pid. next-- sleep_pid=`ps -af |... (3 Replies)
Discussion started by: onlyniladri
3 Replies

5. Shell Programming and Scripting

Newbie Question: Killing a process using a supplied name to a shell script

Hi, I am trying to automate the killing of named processes of which I found a good solution here on the forums but as I am pretty much a begginer to linux I am having an issue. The code I found is: kill $(ps -ef | nawk '/monitoreo start/ { print $2}'} but what I want to do is replace... (3 Replies)
Discussion started by: TylrRssl1
3 Replies

6. Shell Programming and Scripting

Finding the age of a unix process, killing old processes, killing zombie processes

I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time. Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies

7. Shell Programming and Scripting

script not killing process!

i am using script to connect remotly to server and run some commands , one of these commands is to kill some process but tried different ways with no hope sshpass -p 'pass' ssh -o StrictHostKeyChecking=no server kill -9 `pgrep procs` getting error message "kill: bad argument count" ... (2 Replies)
Discussion started by: mogabr
2 Replies

8. AIX

killing a process from a script

Hey all. I'm brand new to this forum and am looking for some help. I have a script that verifies that the backup tapes are working correctly. Basically is uses 1 command: restore -xpqvf > rootvglog I use this for each volume group that we have. We run this everyday but the problem is, we... (4 Replies)
Discussion started by: jalge2
4 Replies

9. Shell Programming and Scripting

killing a child process within a shell

Hi All, I have a written a script in korn shell for importing data into a oracle database. The shell invokes the import within the script. I want to kill this import (child process) . I tries using trap, but this does not kill the import even if i press cnt c. i have to login into other terminal... (2 Replies)
Discussion started by: yerics
2 Replies

10. Shell Programming and Scripting

killing process using a script

can I do ps -ef | grep <process_name> and kill the process is it exists? and send a mail to me that the process was found and killed Thanks much... KS (4 Replies)
Discussion started by: skotapal
4 Replies
Login or Register to Ask a Question
exit(1) 							   User Commands							   exit(1)

NAME
exit, return, goto - shell built-in functions to enable the execution of the shell to advance beyond its sequence of steps SYNOPSIS
sh exit [n] return [n] csh exit [ ( expr )] goto label ksh *exit [n] *return [n] DESCRIPTION
sh exit will cause the calling shell or shell script to exit with the exit status specified by n. If n is omitted the exit status is that of the last command executed (an EOF will also cause the shell to exit.) return causes a function to exit with the return value specified by n. If n is omitted, the return status is that of the last command exe- cuted. csh exit will cause the calling shell or shell script to exit, either with the value of the status variable or with the value specified by the expression expr. The goto built-in uses a specified label as a search string amongst commands. The shell rewinds its input as much as possible and searches for a line of the form label: possibly preceded by space or tab characters. Execution continues after the indicated line. It is an error to jump to a label that occurs between a while or for built-in command and its corresponding end. ksh exit will cause the calling shell or shell script to exit with the exit status specified by n. The value will be the least significant 8 bits of the specified status. If n is omitted then the exit status is that of the last command executed. When exit occurs when executing a trap, the last command refers to the command that executed before the trap was invoked. An end-of-file will also cause the shell to exit except for a shell which has the ignoreeof option (See set below) turned on. return causes a shell function or '.' script to return to the invoking script with the return status specified by n. The value will be the least significant 8 bits of the specified status. If n is omitted then the return status is that of the last command executed. If return is invoked while not in a function or a '.' script, then it is the same as an exit. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
break(1), csh(1), ksh(1), sh(1), attributes(5) SunOS 5.10 15 Apr 1994 exit(1)