- 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ù)導(dǎo)論:思維、技術(shù)與應(yīng)用
- 運(yùn)動(dòng)控制器與交流伺服系統(tǒng)的調(diào)試和應(yīng)用
- CompTIA Linux+ Certification Guide
- Grome Terrain Modeling with Ogre3D,UDK,and Unity3D
- Unity Multiplayer Games
- Salesforce Advanced Administrator Certification Guide
- AI的25種可能
- 重估:人工智能與賦能社會(huì)
- 機(jī)床電氣控制與PLC
- 數(shù)字多媒體技術(shù)基礎(chǔ)
- 基于人工免疫原理的檢測(cè)系統(tǒng)模型及其應(yīng)用
- 智能控制技術(shù)及其應(yīng)用
- AVR單片機(jī)C語(yǔ)言程序設(shè)計(jì)實(shí)例精粹
- 巧學(xué)活用WPS
- 嵌入式系統(tǒng)原理與接口技術(shù)