On Solaris, what is the difference between cut and gcut?
- by Chris J
I recently came across this crazy script bug on one of my Solaris machines. I found that cut on Solaris skips lines from the files that it processes (or at least very large ones - 800 MB in my case).
> cut -f 1 test.tsv | wc -l
457030
> gcut -f 1 test.tsv | wc -l
840571
> cut -f 1 test.tsv > temp_cut_1.txt
> gcut -f 1 test.tsv > temp_gcut_1.txt
> diff temp_cut_1.txt temp_gcut_1.txt | grep '[<]' | wc -l
0
My question is what the hell is going on with Solaris cut? My solution is updating my scripts to use gcut but... what the hell?