I'm trying to sort a big file(over 400mb) using the following script(very simple) for this task:
for x in $(cat 'file.txt');
do echo $x;
done | sort | uniq
That's all ok until I process file below 120 mb. If I try to process files more than this I got this:
./k2.sh: xmalloc: ../bash/make_cmd.c:100: cannot allocate 4 bytes (2906546176 bytes allocated)
I have a BT 5 KDE and a dual core with 4 Gb ram.
I must admit that could be so simply(or not?) but I cannot found a good answer to this and tried many searches. Google included.
Last edited by fulano35; 01-05-2012 at 12:39 AM.