php & shell 运维研发工程师
Forge ahead, and you'll see some of the possibilities of using PHP for simple — or not-so-simple — shell scripting.
向前迈进,并且您将会看到将php用于简单或者不那么简单的shell脚本的一些可能性。
The first example, written in PHP, will capture the output of the shell command "df -h," place the output into an array, and then examine each line of output against a regular expression.
采用PHP编写的第一个示例将捕获Shell命令“df—h”的输出,将输出放在一个数组中,然后根据一个正则表达式检查输出的每一行。
With Python, the subprocess module handles making the system call to the shell command, and puts it into a list, called in array in Bash or PHP.
对于 Python,子过程模块处理对 Shell 命令的系统调用,并将输出发在一个列表(在 Bash 和 PHP 中称为数组)中。
应用推荐