- 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.
推薦閱讀
- 后稀缺:自動化與未來工作
- 課課通計算機原理
- SCRATCH與機器人
- ETL with Azure Cookbook
- 圖形圖像處理(Photoshop)
- 大數據技術入門(第2版)
- VMware Performance and Capacity Management(Second Edition)
- Implementing AWS:Design,Build,and Manage your Infrastructure
- 網中之我:何明升網絡社會論稿
- TensorFlow Reinforcement Learning Quick Start Guide
- 大數據技術基礎:基于Hadoop與Spark
- MATLAB-Simulink系統仿真超級學習手冊
- 三菱FX/Q系列PLC工程實例詳解
- 和機器人一起進化
- DynamoDB Applied Design Patterns