at command args
Rob Lemley
rob at b15.INGR.COM
Thu Nov 15 04:27:00 AEST 1990
In <5195 at crystal1.UUCP> mostek at motcid.UUCP (Frank B. Mostek) writes:
>Would like to be able to pass parameters to a script invoked by the
>"at" command. Have tried:
> at now + 1 minute test xyz
> where xyz is the parameter I want to pass to the test
> script.
>The script is executed, but the parameter is ignored.
First, a caveat, aside from any problems with "at":
BE CAREFUL WHEN YOU NAME A SCRIPT test. test IS A BUILTIN
COMMAND IN THE MODERN sh AND ksh. EXECUTING test WITHOUT A
QUALIFYING PATH NAME WILL USUALLY EXECUTE THE SHELL'S BUILTIN
test COMMAND OR /bin/test ON OLDER SHELLS. ON OLDER SHELLS
THIS WILL DEPEND ON HOW YOUR $PATH IS SET UP. NAMING YOUR OWN
SCRIPT test CAN ALSO CAUSE OTHER SHELL SCRIPTS TO BREAK BECAUSE
THEY PROBABLY EXPECT DIFFERENT BEHAVIOR FROM test THAN WHAT YOU
PROBABLY CODED!
Now, back to "at":
Are you sure the script is executed? What version of Unix are you on?
On System V, Release 3, "at" will not take commands from the command line.
When I try your example, I get:
at: bad date specification
The usual way to do this would be:
$ at now + 1 minute
test xyz
<control-d> #or whatever your EOF char is
>From the User's Ref Man:
at and batch read commands from standard input to be
executed at a later time. ^^^^^^^^^^^^^^
Rob
--
Rob Lemley
System Consultant, Scanning Software, Intergraph, Huntsville, AL
rcl at b15.ingr.com OR ...!uunet!ingr!b15!rob
205-730-1546
More information about the Comp.unix.shell
mailing list