Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

spiffier atrm's than Debian

2 views
Skip to first unread message

Dan Jacobson

unread,
Aug 21, 2004, 3:03:21 PM8/21/04
to
Do other leading brands of Linux have spiffier atrm's than Debian?
$ atrm your_mom; echo $?
0

chris-...@roaima.co.uk

unread,
Sep 1, 2004, 10:04:49 AM9/1/04
to

Accepted that this is not particularly useful behaviour, it doesn't look
to be too difficult to write a shell script wrapper that provides the
"correct" behaviour. (However, consider the following two questions. If
you specify two jobs to remove but only one is valid, what exit status
do you want to return? If you specify two jobs to remove and neither
are valid, what exit status do you want to return?)

SS=0
for JOBID in "$@"
do
ISBATCHED=`atq | awk '$1 == "'"$JOBID"'" {print $0}'`
if test -n "$ISBATCHED"
then
atrm "$JOBID"
else
SS=`expr "$SS" + 1`
fi
done
exit "$SS"

Of course, this needs to be extended to handle job queues and the like,
but the basics are here.

Chris

Dan Jacobson

unread,
Sep 4, 2004, 5:46:39 PM9/4/04
to
c> write a shell script wrapper that provides the "correct" behaviour.

Best to fix the program itself. I suppose all Linux distributions use
such an atrm.

c> If you specify two jobs to remove but only one is valid, what exit
c> status do you want to return? If you specify two jobs to remove
c> and neither are valid, what exit status do you want to return?)

Error [non zero]

0 new messages