execute two shell commands in single exec php statement

后端 未结 5 955
走了就别回头了
走了就别回头了 2020-12-03 07:25

I want to display all the files that are modified after a specified date

the commands are

touch --date \'2011-09-19 /home/  , find /home/

5条回答
  •  猫巷女王i
    2020-12-03 07:48

    You can use either a ; or a && to separate the comands. The ; runs both commands unconditionally. If the first one fails, the second one still runs. Using && makes the second command depend on the first. If the first command fails, the second will NOT run.

    command1 ; command2     (run both uncondtionally)
    command1 && command2     (run command2 only if command1 succeeds)
    

提交回复
热议问题