how to use non-printable char as field separator of sort command in bash?

bash, shell, sorting

Solution

There is a special quoting in bash, that can be used for this purpose. Try the following command and look for `$'...'` in the bash manual:

sort -t $'\05' file

Problem

The sort command has a parameter "-t" to declare the fields separator instead of the default blank. For example: ``` sort -t 'a' file ``` what if I want to use a non-printable char as the spearator, like the fifth char in ASCII table ?

Original source