- Learning Linux Shell Scripting
- Ganesh Naik
- 162字
- 2021-06-25 22:02:53
Command1; command2
A command line can consist of multiple commands. Each command is separated by a semicolon, and the command line is terminated with a newline. The exit status is that of the last command in the chain of commands.
The first command is executed, and the second one is started as soon as the first one has finished:
$ w; date
Output:
$ w ; date > whoandwhen
Output from the date command will be redirected to the whoandwhen file.
In the preceding example, we can see that when we put multiple commands on the same line, but separated by the ; command, then those commands execute sequentially one by one:
$ date; who am i Tue Mar 10 23:21:38 PDT 201 student pts/0 2015-03-10 23:12 (:0.0)
In the preceding example, the date command is executed first and the who am I command will be executed next. Both the commands are typed on the same lines, separated by the ; command.
推薦閱讀
- Hadoop 2.x Administration Cookbook
- 城市道路交通主動控制技術
- Spark大數據技術與應用
- 21天學通C語言
- LAMP網站開發黃金組合Linux+Apache+MySQL+PHP
- 零起點學西門子S7-200 PLC
- Hands-On SAS for Data Analysis
- 機床電氣控制與PLC
- 智能制造系統及關鍵使能技術
- Visual Basic項目開發案例精粹
- 人工智能云平臺:原理、設計與應用
- 基于Quartus Ⅱ的數字系統Verilog HDL設計實例詳解
- 大數據:從基礎理論到最佳實踐
- Hands-On Artificial Intelligence for Beginners
- 工業控制系統安全