&& 表示第一条命令正确执行才会继续执行第二条命令
[root@localhost 11]# ls 1.txt && ls 2.txt
|| 表示第一条命令没有正确执行才会执行第二条命令
[root@localhost 11]# ls 1.txt || ls 2.txt
; 第一条命令正确执行与否第二要命令都会执行
[root@localhost 11]# ls 1.txt ; ls 2.txt
文章标签 shell 中的连接符(并且&&、与; 文章分类 运维
&& 表示第一条命令正确执行才会继续执行第二条命令
[root@localhost 11]# ls 1.txt && ls 2.txt
|| 表示第一条命令没有正确执行才会执行第二条命令
[root@localhost 11]# ls 1.txt || ls 2.txt
; 第一条命令正确执行与否第二要命令都会执行
[root@localhost 11]# ls 1.txt ; ls 2.txt
最近想要实现通过脚本循环再Linux下运行shell命令,经过探索发现使用Python语言有几种解决方案,在此简单记录。
linux shell判断文件或目录是否存在
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M