[Novices] very simple at commands

Steve Petersen steve.petersen at charter.net
Tue Feb 22 16:23:21 EST 2005


Oh, right, piping.  I reckon I could do that.  (If I remember, and 
remember to enclose the command I want to pipe into "echo".)

Hmn.  How might I (or you!) write a shell script that takes an at-like 
time spec and a command line and does the command at the time?  I 
*think* using that script would be easiest for me to remember later, and 
anyway it would be a good lesson for me in shell scripting.  A script 
'doat' where I could type

	$ doat now + 1 minute echo "Go to the meeting"

That would seem hard to code up.  Maybe easier with a '-c' between them 
(though that would also take remembering).

Also, I had forgotten (or never knew) that standard output of at gets 
mailed.  I don't often use it for echo, as in my example, but is there 
any way to send it to the invoking terminal instead?

Maybe I should just remember ^D.  I used to use it 15 years ago for 
writing email, after all.  But I can't think of another case where I use 
it today.

Thanks again novice-helpers,
Steve

Bruce Smith wrote:
>>Every time I want to use the 'at' command, I keep assuming it will let 
>>me just type something like
>>
>>	$ at now + 5 minutes echo "Go to your meeting!"
> 
> 
> This works:
> 
> echo 'echo Go to your meeting' | at now + 5 minutes
> 
> (you realize that's going to send you email, right?)
> 
> Or if you want to put multiple lines in a shell script:
> 
> --------------------------
> #!/bin/sh
> at now + 1 minute << EOF
> echo one
> echo two
> EOF
> --------------------------
> 
>  - BS
> 
> 
> _______________________________________________
> Novices mailing list
> Novices at kalamazoolinux.org
> http://www.kalamazoolinux.org/mailman/listinfo/novices


More information about the Novices mailing list