Question Details

Browse

kill command output redirect

By Jayant Sriram - Aug. 08, 2008

I have a doubt regarding the redirecting output of kill command
i have given like this
./sample.sh &
pkill -SIGSEGV sample.sh
then i would get
[2]- Segmentation fault (core dumped) ./sample.sh

my question is , i should not get this output i mean the above line should be avoided at the output

i have tried out with many redirect operators
1) pkill -SIGSEGV sample.sh 1> file 2> file
2) pkill -SIGSEGV sample.sh &>/dev/null

the last one is
3) pkill -SIGSEGV sample.sh &>/tmp/corefiles/core , where actually i am creating core files, here now i am not getting any error at output ,but now core files are not generated.

please tell me how to avoid the output of pkill


Answers

Add Answer
  1. By Taylor Jing on Aug. 08, 2008

    First of all, pkill is not a ""kill"" command. I'd say it is a script wrapper around kill command.


    Secondly, kill should not normally give any output.


    Thirdly, what you're seeing is the output of the sample.sh when it is being killed. That is the default signal handler for SIGSEGV.


    If you wish to prevent that output, your sample.sh should take care of redirecting it's output streams.


    0 Votes
Share your knowledge

Related Questions

Browse Get answers and share your expertise.