I am executing a bash script in php file.
This is my code, which is not providing any output.
<?php
$eff="195";
$chain="B";
$struct_pos="2";
$pre_line=exec("tail $i.dssp -n $eff | awk '$3==$chain'| awk -F' ' -v var=$struct_pos '{if ($2==var) print FNR}'");
?>
However, following codes works properly, in which I have removed one of the awk statements.
$pre_line=exec("tail $i.dssp -n $eff | awk -F' ' -v var=$struct_pos '{if ($2==var) print FNR}'");
$pre_line=exec("tail $i.dssp -n $eff | awk '$3==$chain'");
What is the solution to this problem ?
尝试这个..,
$pre_line=exec("tail $i.dssp -n $eff | awk '$3==\"'$chain'\"'| awk -F' ' '{if ($2=='$struct_pos') print FNR}'");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.