从ssh执行的linux命令输出中选择特定数据作为php代码中的变量
我想从命令输出中选择特定的数据,该命令输出是通过ssh和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
=> 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