Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/262.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从ssh执行的linux命令输出中选择特定数据作为php代码中的变量_Php_Linux_Ssh - Fatal编程技术网

从ssh执行的linux命令输出中选择特定数据作为php代码中的变量

从ssh执行的linux命令输出中选择特定数据作为php代码中的变量,php,linux,ssh,Php,Linux,Ssh,我想从命令输出中选择特定的数据,该命令输出是通过ssh和php脚本执行的。将选定的特定数据重新用作变量 命令行输出如下 => Processing triangulated mesh => Generating perimeters => Generating skirt Done. Process took 0 minutes and 10.266 seconds Meters required: 13537.8mm (95.7cm3) ``` Here from abov

我想从命令输出中选择特定的数据,该命令输出是通过ssh和php脚本执行的。将选定的特定数据重新用作变量

命令行输出如下

=> Processing triangulated mesh
=> Generating perimeters
=> Generating skirt
Done. Process took 0 minutes and 10.266 seconds
Meters required: 13537.8mm (95.7cm3) ```

Here from above output i would like to select '13537.8' to reuse in php script
Suggest me code how to select data and use as variable in php script

I tried to save output to text file and copy data using "grep" is now working.
grep -Po '(Meters required: \K[^ ]+)' /root/convertlog/89941a6fdd9ddd5f641faf46b05cd0b0f629.txt