Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'kill' in bash script



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




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org