- Learning Linux Shell Scripting
- Ganesh Naik
- 90字
- 2021-06-25 22:02:54
Command1 && command2
The second command is only started if the first command is successful. To achieve this, the shell checks the exit (return) status of the first command and starts the second command only if and when that exit status is found to be 0:
$ ls /home/ganesh && echo "Command executed successfully" Since we are working as user ganesh, $ ls /root && echo "Command executed successfully"
Since we are working as a normal user, we cannot access the /root directory. Therefore, nothing will be printed on screen.
推薦閱讀
- 大數(shù)據(jù)管理系統(tǒng)
- JavaScript實例自學(xué)手冊
- Python Artificial Intelligence Projects for Beginners
- 計算機應(yīng)用復(fù)習(xí)與練習(xí)
- Hands-On Data Science with SQL Server 2017
- 空間傳感器網(wǎng)絡(luò)復(fù)雜區(qū)域智能監(jiān)測技術(shù)
- 21天學(xué)通Visual Basic
- AWS Certified SysOps Administrator:Associate Guide
- 網(wǎng)絡(luò)安全管理實踐
- OpenStack Cloud Computing Cookbook
- 基于敏捷開發(fā)的數(shù)據(jù)結(jié)構(gòu)研究
- Artificial Intelligence By Example
- TensorFlow Deep Learning Projects
- 傳感器原理與工程應(yīng)用
- ARM嵌入式系統(tǒng)開發(fā)完全入門與主流實踐