execute two shell commands in single exec php statement

后端 未结 5 952
走了就别回头了
走了就别回头了 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条回答
  •  盖世英雄少女心
    2020-12-03 07:34

    This is how I did it simultaneously encode thumbs, and then flv video..I need to generate 2 thumbs from avi file. After the thumbs I need to convert the same avi to flv or whatever. So, here is the code I normally used.

    $command_one = "do whatever the script does best";
    $command_two = "do whatever the script does second best";
    //execute and redirect standard stream ..
    @exec($command_one."&& ".$command_two.">/dev/null 1>/dev/null 2>/dev/null &");
    

    You can also run array of commands with exec, if you want :)

    foreach($crapatoids as $crap){
    
    $command_name = $crap;
    //exec the crap below
    @exec ($command_name." >/dev/null 1>/dev/null 2>/dev/null &");
    }
    

提交回复
热议问题