Sponsored Content
Top Forums Shell Programming and Scripting Script Works But Need It to Exit Upon Closing Program Post 303031650 by RudiC on Sunday 3rd of March 2019 04:47:46 PM
Old 03-03-2019
Not sure the killall will work satisfyingly ... kill $PID will.

Just append the kill command - whichever you use - to the chrome.sh script so it will execute when chrome terminates.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Line works in solo but not in program?

Now I am just getting frustrated and confused... if anyone has some advice on how this anomoly is occurring I would greatly appreciate it. cat helpme.txt | awk 'NR<5{printf("%-20s %-20d %-20d %-20.1f\n","hello",$1,$2,$3)}' | sort -rk4 This line works fine in solo - reads the three fields from... (4 Replies)
Discussion started by: nortypig
4 Replies

2. UNIX for Dummies Questions & Answers

EXIT from a Program not from the function..

Hi, I want a command in unix shell script which will exit my whole program, not only from the function it's using. For e.g: $1 == "m_who" && $4 == "Extrnl Vendor" { print "You don have access" exit (0); } If this error is showing on the screen, then nothing should not... (9 Replies)
Discussion started by: ronix007
9 Replies

3. Shell Programming and Scripting

Terminal is closing on exit in ksh

hi while executing the following script, my terminal window is getting closed if I enter a invalid option. I want the script should go back the the command prompt. how to do achive it. i execute the script as . ./test #! /usr/bin/ksh Printf " Type of Installer : \n\t\t 1. Whole Build... (3 Replies)
Discussion started by: vij_krr
3 Replies

4. Solaris

Graphical program no longer works after Solaris 10 upgrade

This is a fairly complex issue. I do not have a lot of knowledge on X11. But here are the things. I am running a program called Synergy off a Solaris server. The server sits in a remote network and can be accessed via NAT. Using Putty, I will enable X11 forwarding and launch Synergy via Putty.... (0 Replies)
Discussion started by: Leion
0 Replies

5. Shell Programming and Scripting

Linux:Program exit with displaying a print feature

hi All I have a scritp running which connects to a local host and then gets a value from a field and then ftp that value to antoher server. It is running fine, and from crontab it gives the output to a file, the problem is sometime it doesnt run but if i check the output file it does not show one... (0 Replies)
Discussion started by: imran721
0 Replies

6. Shell Programming and Scripting

I dont want to exit the program by ctrl + c

Hey , guys I am new to shell programing ,, so need a help from you guys ... I have to write a shell script that accepts file name or directory name from the user if it is a directory then throw an error if it is a file then give the user two options . 1.overwrite the content 2.append the... (2 Replies)
Discussion started by: coolashu
2 Replies

7. UNIX for Dummies Questions & Answers

C-program works fine interactively, but not on the SGE server

Greetings, I have a C-program that is made to implement a hidden Markov model on an input file. The program is very memory intensive. I've installed it on my local server where I have an account and it compiles fine. The way they have the server set up is that you can either work... (1 Reply)
Discussion started by: Twinklefingers
1 Replies

8. Shell Programming and Scripting

Help with Shell Script opening and closing a program

REALLY new to this stuff, sorry. So I want a shell script to open a program, wait 45 minutes, close it, and then do it all again. I want to do this because I am running an iMacros Script for a long period of time and if Firefox is not constantly restarted, memory leaks start to happen. Anyway... (6 Replies)
Discussion started by: plsbbg
6 Replies

9. Shell Programming and Scripting

Need to understand how the line in perl program works as shell commend

I have a file with two line, one is header, the other actual value: TYPCD|ETID2|ETID|LEG ID|PTYP|PTYP SUB|TRD STATUS|CXL REASON|CACT|CACTNM|ENCD|ENC D NM|TRDR|ASDT|TRDT|MTDT|STDT|LS|SECID|SECID TYP|SECNM|PAR|STCC|MARKET PRICE|DIS MARKET PRICE|MARKET PRICE CURRENCY|SRC OF SETTLEMENT... (2 Replies)
Discussion started by: digioleg54
2 Replies

10. Shell Programming and Scripting

Exit script and open program via other user

Hello all.. so i have a problem i need to solve .. #! /bin/bash $SHELL dtterm -title my_prog -e su -user -c 'export DISPLAY=:0.0 ; /path/to/my/prog' & 2> /dev/null $SHELL intr exit This script will work on solaris 10 system in right clikt menu - in a secure system so i need to... (0 Replies)
Discussion started by: defs
0 Replies
KILLALL(1)							   User Commands							KILLALL(1)

NAME
killall - kill processes by name SYNOPSIS
killall [-e,--exact] [-g,--process-group] [-i,--interactive] [-q,--quiet] [-v,--verbose] [-w,--wait] [-V,--version] [-S,--sid] [-c,--con- text] [-s,--signal signal] [--] name ... killall -l killall -V,--version DESCRIPTION
killall sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent. Signals can be specified either by name (e.g. -HUP) or by number (e.g. -1). If the command name contains a slash (/), processes executing that particular file will be selected for killing, independent of their name. killall returns a zero return code if at least one process has been killed for each ilisted command. killall returns zero otherwise. A killall process never kills itself (but may kill other killall processes). OPTIONS
-e, --exact Require an exact match for very long names. If a command name is longer than 15 characters, the full name may be unavailable (i.e. it is swapped out). In this case, killall will kill everything that matches within the first 15 characters. With -e, such entries are skipped. killall prints a message for each skipped entry if -v is specified in addition to -e, -g, --process-group Kill the process group to which the process belongs. The kill signal is only sent once per group, even if multiple processes belong- ing to the same process group were found. -i, --interactive Interactively ask for confirmation before killing. -l, --list List all known signal names. -q, --quiet Do not complain if no processes were killed. -v, --verbose Report if the signal was successfully sent. -V, --version Display version information. -w, --wait Wait for all killed processes to die. killall checks once per second if any of the killed processes still exist and only returns if none are left. Note that killall may wait forever if the signal was ignored, had no effect, or if the process stays in zombie state. -S (Flask only) Specify SID: kill only processes with given SID. Mutually exclusive with -c argument. Must precede other arguments on command line. -c (Flask only) Specify security context: kill only processes with given security context. Mutually exclusive with -s. Must precede other arguments on the command line. FILES
/proc location of the proc file system KNOWN BUGS
Killing by file only works for executables that are kept open during execution, i.e. impure executables can't be killed this way. Be warned that typing killall name may not have the desired effect on non-Linux systems, especially when done by a privileged user. killall -w doesn't detect if a process disappears and is replaced by a new process with the same PID between scans. AUTHORS
Werner Almesberger <Werner.Almesberger@epfl.ch> wrote the original version of psmisc. Since version 20 Craig Small <csmall@small.drop- bear.id.au> can be blamed. SEE ALSO
kill(1), fuser(1), pgrep(1), pidof(1), ps(1), kill(2) Linux March 25, 2001 KILLALL(1)
All times are GMT -4. The time now is 06:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy