官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 保山市| 井冈山市| 毕节市| 定襄县| 台南县| 年辖:市辖区| 锡林郭勒盟| 南开区| 高要市| 乌拉特前旗| 贵州省| 安丘市| 大埔区| 昭平县| 密山市| 长寿区| 洛南县| 瑞金市| 普安县| 鄱阳县| 台中县| 永新县| 广东省| 墨竹工卡县| 阿拉善左旗| 西平县| 锦屏县| 波密县| 柳州市| 博白县| 庆安县| 南平市| 开封县| 金乡县| 岳阳市| 榕江县| 石泉县| 德阳市| 原阳县| 岱山县| 霞浦县|