Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 从shell脚本运行awk语句_Linux_Bash_Shell_Awk_Sunos - Fatal编程技术网

Linux 从shell脚本运行awk语句

Linux 从shell脚本运行awk语句,linux,bash,shell,awk,sunos,Linux,Bash,Shell,Awk,Sunos,我想在shell脚本中运行此awk语句: awk -F, '$45==341 && $47==341 && ($13==3) && $15 <=600 && $48==5410 && $50=="pattern"' \ full_path/logfile.log | cut -d, -f15 | sort -unr |head -1 awk-F,'$45==341&&$47==341&&($13==3)&&$

我想在shell脚本中运行此awk语句:

awk -F, '$45==341 && $47==341 && ($13==3) && $15 <=600 && $48==5410 && $50=="pattern"' \
full_path/logfile.log | cut -d, -f15 | sort -unr |head -1

awk-F,'$45==341&&$47==341&&($13==3)&&$15@Cyrus伟大版!谢谢事实上,我正在使用文件的完整路径。我认为问题不在那里,对我来说很好。您能从shell脚本中包含适当的代码段吗?顺便问一下,您的标记正确吗?Linux和Solaris?它以什么方式“失败”?啊,Linux和Solaris。Solaris中默认的
/bin/awk
非常(非常!)旧,并且缺少很多功能。使用
/bin/nawk
/usr/xpg4/bin/awk
。祝你好运。@Cyrus伟大版!谢谢事实上,我正在使用文件的完整路径。我认为问题不在那里,对我来说很好。您能从shell脚本中包含适当的代码段吗?顺便问一下,您的标记正确吗?Linux和Solaris?它以什么方式“失败”?啊,Linux和Solaris。Solaris中默认的
/bin/awk
非常(非常!)旧,并且缺少很多功能。使用
/bin/nawk
/usr/xpg4/bin/awk
。祝你好运