私は次のような状況にあります。
awk '$0 != "Force for tool binder" # print all lines until string found
$0 =="Force for tool binder"{
print ; getline ; print; # go to 2 lines below the string
getline; getline < " forceState$j.k "; print}' dynaFile_Offen1.k > tempDynaFile.k # take the string from
#the file forceStates$j.k and replace in the main file, generating a temp file.
問題は、ここでjがループインデックスであるということです。つまり、最初のケースではj=1です。forceStates1.kとして使用した場合、完全に機能しますが、ループ内では値を取得していません。
私は提案をする義務があります。