[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: In a script, when you kill a process, you get a terminal style messa
From: |
Greg Wooledge |
Subject: |
Re: In a script, when you kill a process, you get a terminal style message... |
Date: |
Mon, 22 Jan 2018 09:51:39 -0500 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Sun, Jan 21, 2018 at 10:23:52AM -0700, gazelle@xmission.com wrote:
> 1) In a script, when you kill a process, you get a terminal style message
> about the process being killed. See below for further description.
Here's a simpler reproducer (no need for external symlinks or killall):
wooledg:~$ cat foo
#!/bin/bash
sleep 100 & pid=$!
kill $pid
wait
wooledg:~$ ./foo
./foo: line 4: 8615 Terminated sleep 100
And I have to agree, a clean way to turn off job control type messages
is something MANY people would love to have.
As it is now, the best solution to this problem is actually to switch
from bash to a different shell.
wooledg:~$ cat foo
#!/bin/sh
sleep 100 & pid=$!
kill $pid
wait
wooledg:~$ ./foo
wooledg:~$
Sad. (That's dash; ksh is also silent.)
The only other solution I know is to redirect stderr to /dev/null,
but that has repercussions that a serious program cannot live with.
- In a script, when you kill a process, you get a terminal style message..., gazelle, 2018/01/21
- Re: In a script, when you kill a process, you get a terminal style message...,
Greg Wooledge <=
- Re: In a script, when you kill a process, you get a terminal style message..., Chet Ramey, 2018/01/22
- Re: In a script, when you kill a process, you get a terminal style message..., Chet Ramey, 2018/01/22