这个bash重定向运算符是什么?<&lt ;! [英] what's this bash redirection operator? "<<!"

查看:77
本文介绍了这个bash重定向运算符是什么?<&lt ;!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了以下bash代码:在19:00<< ;!回显作业1" .我有两个问题:

I saw the following bash code:at 19:00 <<! echo "job 1". I have two problems:

  1. 这是什么重定向操作符:<<!?
  2. 我编写了以下脚本代码:

  1. What's this redirection operator: <<!?
  2. I wrote the following script code:

at 19:00 <<!
    echo "job 1"

at 20:00 <<!
    echo "job 2"

当我执行此脚本时, atq 命令仅显示一个作业,第一个作业.怎么了?我应该如何通过此脚本正确提交两个作业?

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?

推荐答案

<<!您应该写:

at 19:00 <<!
    echo "job 1"
!
at 20:00 <<!
    echo "job 2"
!

没有以开始的行,您的here文档是shell脚本的其余部分,这就是为什么 atq 中只有一个命令的原因.(但是,该命令在运行时会安排第二个作业!)

Without the lines starting !, your here document was the rest of the shell script, which is why there was only one command in the atq. (But, the command would have scheduled the second job when it ran!)

这篇关于这个bash重定向运算符是什么?&lt;&lt ;!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆