此语句就是执行不了,为什么?出现的错误如下:
awk: Field $() is not correct.
The input line number is 1.
The source line number is 1.
...全文
858打赏收藏
shell问题,请教高手!!!
STR="mydoc.txt" echo $STR | awk '{print substr($STR,1,5)}' 此语句就是执行不了,为什么?出现的错误如下: awk: Field $() is not correct. The input line number is 1. The source line number is 1.
To fierygnu(va_list):
好方法!!!CSDN上牛人就是多!谢谢,我用的系统是HP-UX。
To linaxing(牛牛):
也是好方法!tks!呵呵,牛人!!
To freedom_coffee(######) :
老兄的这个方法在我的系统中行不通。
syntax error The source line is 1.
The error context is
{print >>> substr(${ <<<
awk: The statement cannot be correctly parsed.
The source line is 1.
awk: Quitting
The source line is 1.
To windcandle(想不起):
cat: Cannot open mydoc.txt: No such file or directory
syntax error The source line is 1.
The error context is
{print >>> substr(${ <<<
awk: The statement cannot be correctly parsed.
The source line is 1.
awk: Quitting
The source line is 1.