I saw the following bash code:at 19:00 <<! echo "job 1"
. I have two problems:
<<!
?I wrote the following script code:
at 19:00 <<!
echo "job 1"
at 20:00 <<!
echo "job 2"
When I executed this script, atq
command only showed one job, the first one. What's the matter? And how should I submit the two jobs via this script correctly?
From bash reference manual
3.6.6 Here Documents
This type of redirection instructs the shell to read input from the current source until a line containing only word (with no trailing blanks) is seen. All of the lines read up to that point are then used as the standard input for a command.
The format of here-documents is:
<<[−]word
here-document
delimiter
So
word
(in your case !
)at
job on one or more linesword
(again, in your case !
)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With