Can we use PHP in Bash Script?

后端 未结 3 1912
攒了一身酷
攒了一身酷 2021-01-29 08:37

I have a bash script abcd.sh

#!/bin/sh
for i in `seq 8`; do ssh w$i \'uptime;ps -elf|grep httpd|wc -l;free -m;mpstat\'; done &
pid=$!
sleep 1
ki         


        
3条回答
  •  长情又很酷
    2021-01-29 08:50

    Why don't you write the entire shell script in PHP?

    #!/usr/bin/php
    
    

    (code is untested, just an example)

提交回复
热议问题