Echo changes my tabs to spaces Echo changes my tabs to spaces bash bash

Echo changes my tabs to spaces


Try:

cat inputfile.txt | while read line; do echo "$line"; done

instead.

In other words, it's not read replacing the tabs, it's echo.

See the following transcript (using <<tab>> where the tabs are):

pax$ echo 'hello<<tab>>there' | while read line ; do echo $line ; donehello therepax$ echo 'hello<<tab>>there' | while read line ; do echo "$line" ; donehello<<tab>>there