#419547 at: batch no longer accepts parameters

Package:
at
Source:
at
Description:
Delayed job execution and batch processing
Submitter:
Date:
2010-02-16 18:18:03 UTC
Severity:
normal
#419547#5
Date:
2007-04-16 14:35:08 UTC
From:
To:
We have been using the "batch" command in a production environment for
years.  We discovered today that the "batch" command, which is simply a
script that calls the "at" command with arguments, had been changed in a
way that renders it useless.

Here is the present batch script in version 3.1.10:

#! /bin/sh -e
if [ "$#" -gt 0 ]; then
        echo batch accepts no parameters
        exit 1
fi
prefix=/usr
exec_prefix=${prefix}
exec ${exec_prefix}/bin/at -qb now

Here is the previous batch script in version 3.1.8-11:

#! /bin/sh
prefix=/usr
exec_prefix=${prefix}
exec ${exec_prefix}/bin/at -qb now "$@"

Since the batch script will now accept no arguments, then what can it
possibly do ?  Nothing !

The purpose of a batch script is to "submit a job" to a queue for
running in the background.  By removing this capability, the batch
command is presently rendered useless.

As a workaround, we have placed the old batch command of v3.1.8-11
into /usr/local/bin/ so that we can still use it above the delivered one
with v3.1.10.

Also, I agree that the reason for the change (bug report #70988) fixes
the man page to match what batch does.  However, I think that a more
versatile batch is needed or just remove batch altogether.

#419547#10
Date:
2007-04-16 17:52:51 UTC
From:
To:
In a way that renders it compliant with the Single Unix Spec, Version 3.

The Single Unix Spec says that batch should be equivalent to at -q b -m now

You could also invoke at directly, which has a standard-specified interface,
and supports additional parameters for how to schedule jobs.  You haven't
given any examples of non-standard command lines that no longer work, so I
don't know what you feel needs to be there.

The reason for this choice of change is the specification.

#419547#17
Date:
2009-02-15 13:08:48 UTC
From:
To:
The POSIX batch has no parameters. It not useless as it can accept
commands from standard input. The "batch accepts no parameters"
response will ensure scripts are portable.

batch <<__
# List your jobs here
job1
job2
job3
__

#419547#24
Date:
2010-02-16 18:09:18 UTC
From:
To:
Hello,

you can do

  echo "command-to-execute" |batch

works like a charm.


Additionally, the definition of the at call (according to the man
page) is:
at [-V] [-q queue] [-f file] [-mldbv] TIME

It's not intended to submit the actual job on the command line,
neither at nor for batch.

I think this should be redirected as a wishlist item or can be closed.

:wq! PoC