Sponsored Content
Top Forums Shell Programming and Scripting Can I avoid the standard output from kill command Post 16829 by Perderabo on Thursday 7th of March 2002 09:21:19 AM
Old 03-07-2002
That message is coming from the shell that started the process. It is not coming from the kill command. Try starting the process from a subshell, or try sending the shell's stder and stdout to /dev/null. Turning off job control may also work.

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. UNIX for Dummies Questions & Answers

Send output of grep as input of kill command

I would appreciate any help. I need to run 'ps -ef | grep 'process', get the process id and kill that process. I have got this far: - Get pid using ps -ef | awk '/process/{ print $2}' after this I'm kind of stuck.. - Use pipe to redirect the output to kill pid=ps -ef | awk '/bmserver/{... (2 Replies)
Discussion started by: foxtron
2 Replies

4. Shell Programming and Scripting

Command Output to Standard Input

Hi All, How do I provide the output of a command to another command which is waiting for an input from the user ? Ex : I need to login to a device via telnet. In the script, initially I use the "read" command to get the IP Address, Username and Password of the device from the user. Now,... (1 Reply)
Discussion started by: sushant172
1 Replies

5. UNIX for Dummies Questions & Answers

Redirect Standard output and standard error into spreadsheet

Hey, I'm completely new at this and I was wondering if there is a way that I would be able to redirect the log files in a directories standard output and standard error into and excel spreadsheet in anyway? Please remember don't use too advanced of terminology as I just started using shell... (6 Replies)
Discussion started by: killaram
6 Replies

6. Shell Programming and Scripting

sed command works from cmd line to standard output but will not write to file

Hi all .... vexing problem here ... I am using sed to replace some special characters in a .txt file: sed -e 's/_<ED>_/_355_/g;s/_<F3>_/_363_/g;s/_<E1>_/_341_/g' filename.txt This command replaces <ED> with , <F3> with and <E1> with . When I run the command to standard output, it works... (1 Reply)
Discussion started by: crumplecrap
1 Replies

7. UNIX for Dummies Questions & Answers

how to avoid time command output

Hi, I have 2 queries 1 .when I run some unix command, I am getting the output of "time" at std output (screen) for eg zegrep <pattern> *.v.gz I almost found the reason but not sure, if the no of files matching *.v.gz is more then I am getting the time command output at the... (5 Replies)
Discussion started by: selvaka
5 Replies

8. Red Hat

Command understanding the output file destination in case of standard output!!!!!

I ran the following command. cat abc.c > abc.c I got message the following message from command cat: cat: abc.c : input file is same as the output file How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
Discussion started by: ravisingh
3 Replies

9. Shell Programming and Scripting

Avoid single line output from function

I am new to shell scripting and wished to get few things clarified. While calling functions within shell script, output comes out as single line irrespective of the no of echos or newlines I tried within function + the echo -e used to invoke function ( as instructed online) : #!/bin/sh inc() {... (1 Reply)
Discussion started by: RMath
1 Replies

10. Solaris

How to avoid truncating in ps output ?

Hello, This is Solaris 10 (x86) bash-3.2# cat /etc/release Solaris 10 5/09 s10x_u7wos_08 X86 Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 30 March... (5 Replies)
Discussion started by: solaris_1977
5 Replies
wait(1) 						      General Commands Manual							   wait(1)

wait - Awaits process completion SYNOPSIS
wait [pid] Note The C shell has a built-in version of the wait command. If you are using the C shell, and want to guarantee that you are using the command described here, you must specify the full path /usr/bin/wait. See the csh(1) reference page for a description of the built-in command. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: wait: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
One of the following: The unsigned decimal integer process ID of a command, for which the utility is to wait for the termination. A job control job ID that identifies a background process group to be waited for. The job control job ID notation is applicable only for invoca- tions of wait in the current shell execution environment. The exit status of wait is determined by the last command in the pipeline. DESCRIPTION
When an asynchronous list is started by the shell, the process ID of the last command in each element of the asynchronous list becomes known in the current shell execution environment. If the wait utility is invoked with no operands, it waits until all process IDs known to the invoking shell have terminated and exits with a zero exit status. If one or more pid operands are specified that represent known process IDs, the wait utility waits until all of them have terminated. If one or more pid operands are specified that represent unknown process IDs, wait treats them as if they were known process IDs that exited with exit status 127. The exit status returned by the wait utility is the exit status of the process requested by the last pid operand. The known process IDs are applicable only for invocations of wait in the current shell execution environment. RESTRICTIONS
If wait is called in a subshell or separate utility execution environment, such as one of the following, it returns immediately because there are no known process IDs to wait for in those environments: (wait) nohup wait ... find . -exec wait ... ; If the exit status of wait is greater than 128, there is no way for the application to know if the waited-for process exited with that value or was killed by a signal. Since most utilities exit with small values, there is seldom any ambiguity. EXIT STATUS
If one or more parameters were specified, all of them have terminated or were not known by the invoking shell, and the status of the last parameter specified is known, then the exit status of wait is the exit status information of the command indicated by the last parameter specified. If the process terminated abnormally due to the receipt of a signal, the exit status is greater than 128 and is distinct from the exit status generated by other signals. (See the kill -l option.) Otherwise, the wait utility exits with one of the following values: The wait utility was invoked with no operands and all process IDs known by the invoking shell have terminated. The wait utility detected an error. The command identified by the last pid operand specified is unknown. EXAMPLES
Although the exact value used when a process is terminated by a signal is unspecified, if it is known that a signal terminated a process, a script can still reliably figure out which signal using kill as shown by the following script: sleep 1000& pid=$! kill -kill $pid wait $pid echo $pid was terminated by a SIG$(kill -l $?) signal. If either sequence of commands shown on the first two lines is run in less than 31 seconds either of the commands shown on lines 3 and 4 will return the exit sta- tus of the second sleep in the pipeline: sleep 257 | sleep 31 & jobs -l %% wait <pid of sleep 31> wait %% ENVIRONMENT VARIABLES
The following environment variables affect the execution of wait: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale used to affect the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. SEE ALSO
Commands: bg(1), csh(1), fg(1), jobs(1), kill(1), ksh(1), sh(1) Functions: wait(2) Standards: standards(5) wait(1)

Featured Tech Videos

All times are GMT -4. The time now is 04:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy