Article View: comp.unix.shell
Article #1772Re: at command args
From: Rob Lemley
Date: Wed, 14 Nov 1990 17:27
Date: Wed, 14 Nov 1990 17:27
48 lines
1895 bytes
1895 bytes
In <5195@crystal1.UUCP> mostek@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@b15.ingr.com OR ...!uunet!ingr!b15!rob
205-730-1546
Technical Details
Message-ID:
<1795@b15.INGR.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ingr!References:
<5195@crystal1.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ingr! From: rob@b15.INGR.COM (Rob Lemley) Newsgroups: comp.unix.shell Subject: Re: at command args Keywords: at command script args Message-ID: <1795@b15.INGR.COM> Date: 14 Nov 90 17:27:00 GMT References: <5195@crystal1.UUCP> Distribution: comp,local Organization: Intergraph Huntsville Lines: 48 th: b15!rob