I recently run into the following proposed solution:cat results.csv | tr $'\x01' \\t > result.csvto convert a malformed csv file (one that uses \x01 unicode as a separator) into a correct one.What exactly does $'\x01' tell bash to do? The command does not seem to work well in Zsh.In case it matters, the actual goal is to convert something like:b'flight_uid\twinning_price\tbid_price\timpressions_source_timestamp\n'b'0FY6ZsrnMy\x012000\x012270.0\x011427243278000\n0FamrXG9AW\x01710\x01747.0\x011427243733000\n0FY6ZsrnMy\x012000\x012270.0\x011427245266000\n0FY6ZsrnMy\x012000\x012270.0\x011427245088000\n0FamrXG9AW\x01330\x01747.0\x011427243407000\n0FamrXG9AW\x01710\x01747.0\x011427243981000\n0FamrXG9AW\x01490\x01747.0\x011427245289000\n0FamrXG9AW\x01735\x01747.0\x011427244634000\n0FamrXG9AW\x01420\x01747.0\x011427245595000\n0FamrXG9AW\x01470\x01747.0\x011427242443000\n0FK9yvBt9B\x011050\x011295.0\x011427242253000\n0FK9yvBt9B\x011050\x0112%into a a regular tab-separated csv file.When I try this with Zsh, I get the following, which doesn't seem to change anything:b'flight_uid\twinning_price\tbid_price\timpressions_source_timestamp\n'b'0FY6ZsrnMy\x012000\x012270.0\x011427243278000\n0FamrXG9AW\x01710\x01747.0\x011427243733000\n0FY6ZsrnMy\x012000\x012270.0\x011427245266000\n0FY6ZsrnMy\x012000\x012270.0\x011427245088000\n0FamrXG9AW\x01330\x01747.0\x011427243407000\n0FamrXG9AW\x01710\x01747.0\x011427243981000\n0FamrXG9AW\x01490\x01747.0\x011427245289000\n0FamrXG9AW\x01735\x01747.0\x011427244634000\n0FamrXG9AW\x01420\x01747.0\x011427245595000\n0FamrXG9AW\x01470\x01747.0\x011427242443000\n0FK9yvBt9B\x011050\x011295.0\x011427242253000\n0FK9yvBt9B\x011050\x0112%
What does $'text' do exactly in Bash? Can it be used in Zsh?
bash;zsh;tr
From the bash documentation:Words of the form $'string' are treated specially.  The word expands tostring, with backslash-escaped characters replaced as specified by  theANSI  C  standard.  Backslash escape sequences, if present, are decodedas follows:       \a     alert (bell)(...)       \nnn   the eight-bit character whose value is  the  octal  value              nnn (one to three digits)       \xHH   the  eight-bit  character  whose value is the hexadecimal              value HH (one or two hex digits)So, in the example you posted, $'\x01' is just the character withcode 1, as per your description. From my (very limited) testing, thisappears to be supported by zsh as well:$ printf %s $'\x01' | od -t x10000000 010000001However, the tr command that you posted will only solve your problemif we assume that your file in fact contains the literal characterwith code 1; it appears from the comments that what you have insteadis the four-character string \x01 where the tab character shouldbe. The following filter should fix this condition:sed 's/\\x01/\t/g'