24小时热门版块排行榜    

查看: 597  |  回复: 1

lindlar0078

木虫 (著名写手)

[求助] Shell脚本出错,求解答

运行脚本时,出现如下错误,不知道是什么原因,求解答?
ab: line 5:  : command not found
awk: /Inte\(R\) Fortran Inte\(R\) 64 Compiler XE for applications running on Intel\(R\) 64,/  {if (length($14) > 0) print $14};\
awk:                                                                                                                           ^ 反斜杠不是行的最后一个字符

脚本内容如下:

!/bin/sh

   ` ifort -V  2>&1 | \
                      awk '/Inte\(R\) Fortran Inte\(R\) 64 Compiler XE for applications running on Intel\(R\) 64,/  {if (length($14) > 0) print $14};\
                           /^Version / {print $2}'`
                                     if [ ${#version} -ge 3 ]; then
                                           majorvsn=`echo $version | sed -e 's/\..*//'`
                                           minorvsn=`echo $version | sed -e 's/^[^\.]*.//'`

                                     fi
回复此楼

» 猜你喜欢

一切从头开始!
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

chembetsey

木虫 (小有名气)

【答案】应助回帖

感谢参与,应助指数 +1
把下面语句的反引号去掉,改成下面这样试试
ifort -V  2>&1 | \
                      awk '/Inte\(R\) Fortran Inte\(R\) 64 Compiler XE for applications running on Intel\(R\) 64,/  {if (length($14) > 0) print $14};\
                           /^Version / {print $2}'
2楼2012-12-04 05:03:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 lindlar0078 的主题更新
信息提示
请填处理意见