我有以下情况。awk使用循环时出现错误
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它工作完美,但在循环中没有采取的价值。
我将不得不提供建议。
什么是错误信息? – kev 2012-03-06 15:11:58
@kev这是一个逻辑错误,而不是语法错误。我的意思是说,它对这个命令没有任何作用。 – 2012-03-06 15:22:09