Any idea why sort utility gives me incorrect results?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: EDIT: To be clear, we got our STDOUT from a for loop that goes something like this for (( i=1; i<="$FILE_AMOUNT"; i++ )); do MY_FILE=`find $DIR -type f | head -$i | tail -1` FILE_TYPE=`file -b "$MY_FILE" FILE_TYPE_COUNT=`echo $FILE_TYPE" | sort | uniq -c` echo "$FILE_TYPE_COUNT" done Hence our STDOUT is basically output from file utility printed one by one, instead of it actualling being set of strings we can copy - which is likely the core behind all of the issues ` So there's a pickle i absolutely can't wrap my head around. Basically i'm