arlong0451 发表于 2014-12-19 17:01

关于awk:There is not enough memory available now.问题

各位大侠,我在使用awk时出现了以下问题,请问高手指点:
sh datacomp.sh BB_20141215010000_0014451.0027262989 AA_20141215010000_0014451.0029418138
****************************************begin***********************************************
The fisrt file is BB_20141215010000_0014451.0027262989
The second file is AA_20141215010000_0014451.0029418138
1.******正在生成一致数据******
Fri Dec 19 16:51:05 BEIST 2014
awk: There is not enough memory available now.

The input line number is 9.11398e+06. The file is BB_20141215010000_0014451.0027262989.
The source line number is 1.

以下是awk的脚本
. ~/.profile
echo ****************************************begin***********************************************


file1=$1
file2=$2

if [ $# != 2 ];then
    echo "Usage: sh datacomp.sh file1 file2"
    exit
fi

if [ $file1 = "" ]||[ $2 = "" ]
then
echo Usage: sh datacomp.sh file1 file2
exit
else
echo "The fisrt file is $file1"
echo "The second file is $file2"
fi

#两个文件的比较字段是第1、5、6,如果比较其他字段需要修改参数
echo1.******正在生成一致数据******
date
wk -F "|" 'NR==FNR{a[$1 $5 $6]=1}(NR!=FNR){if(a[$1 $5 $6]==1){print $0}}' $file1 $file2 >datacon_${file2}
date
awk -F "|" 'NR==FNR{a[$1 $5 $6]}NR!=FNR&&($1 $5 $6 in a )' $file2 $file1 >datacon_${file1}

echo2.******正在生成$file1文件差异数据******
date
awk -F "|" 'NR==FNR {a[$1 $5 $6]} NR>FNR&&!($1 $5 $6 in a)' datacon_${file1} $file1>RES_$file1

echo3.******正在生成$file2文件差异数据******
date
awk -F "|" 'NR==FNR {a[$1 $5 $6]} NR>FNR&&!($1 $5 $6 in a)' datacon_${file2} $file2>RES_$file2

echo ****************************************end***********************************************
date
我已经将rss及stack及其它的参数改为-1了,还是不是ulimit -a 显示如下:
time(seconds)      unlimited
file(blocks)         unlimited
data(kbytes)         unlimited
stack(kbytes)      unlimited
memory(kbytes)       unlimited
coredump(blocks)   unlimited
nofiles(descriptors) unlimited
谢谢各位了。
页: [1]
查看完整版本: 关于awk:There is not enough memory available now.问题