例如如下内容进行排序:
foo<tab>1.00<space>1.33<space>2.00<tab>3
默认使用空格分隔进行排序:
$ sort -k3nr file.txt # apparently this sort by space as delimiter
当指定使用tab进行排序:
$ sort -t"\t" -k3nr file.txt
sort: multi-character tab `\\t'
出错!
可以通过下面方式:
$ sort -t$'\t' -k3 -nr file.txt
注意在使用单引号时前面的"$"符,相关参考 ANSI-C Quoting sections of the bash man page.