'kill' in bash script

Kuan Lee kuanlee at erols.com
Thu Feb 3 14:06:43 EST 2000


Pausing before the last shore of time, Ron Peterson wrote:
> 
> Here's the error message cron emails to me:
> 
> > usage: kill [ -s signal | -p ] [ -a ] pid ...
> >        kill -l [ signal ]
> > 647
> > Could not open X display "".

The first message tells you that kill received unexpected arguments, 
no args in this case
The second message is because $DISPLAY is not set when it executes backfract.


> This script *does* work if I call it manually.  Here's the whole thing:
> 
> #!/bin/bash
> cd /home/ybrp01/temp
> /bin/ps ax | /bin/grep [b]ackfract | /bin/awk '{print $1}' |

Try adding a line continuation above, like
/bin/ps ax | /bin/grep [b]ackfract | /bin/awk '{print $1}' | \
Don't understand why it works in when called from the at the console
instead of by crond.


> /usr/bin/xargs -n1 kill
> /usr/games/bin/backfract -delay 240 -colors 256

Try
/usr/games/bin/backfract -delay 240 -colors 256 -display 127.0.0.1:0



> My best guess:  bash has both an interactive and a non-interactive
> mode.  Does bash not allow 'kill' in non-interactive mode?  Any way
> around this, if that's true?

No such thing as I understand it.

-- 
-==-
Kuan Lee
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list