How to script at job creation?

Karl Auer kauer at biplane.com.au
Fri Dec 11 11:13:27 UTC 2020


On Fri, 2020-12-11 at 11:10 +0100, Bo Berglund wrote:
> > eval $CMDAT
> 
> Thanks!
> This is what solved the problem.
> Seems similar to the Windows exec command.

There is a bash exec command too - eval runs the command in a subshell
and returns, exec replaces the running process with the new one.

> The only way I found by searching the net in order to have a 1-line
> command to set an at task was to use the echo trick and pipe the
> output into at as shown.

You could make a function that takes the changing components and
executes at... then each "script" is a one-liner calling the function.

> > echo $ATINPUT | $AT
> 
> I guess you forgot the eval keyword here... :)

Doesn't need it.

Regards, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer

GPG fingerprint: 2561 E9EC D868 E73C 8AF1 49CF EE50 4B1D CCA1 5170
Old fingerprint: 8D08 9CAA 649A AFEF E862 062A 2E97 42D4 A2A0 616D







More information about the ubuntu-users mailing list