Subject: Re: Terminal tab expansion
To: Michal Pasternak <michal@pasternak.w.lub.pl>
From: Thomas Bieg <tomsbsd03@t-email.de>
List: netbsd-help
Date: 08/10/2003 17:30:21
Micha³ Pasternak wrote:
>
> cat somefile | tr \\t " "
>
This won't work as expected. The two arguments of tr are
regarded as two sets of characters, mapping each character
of the first argument one-by-one to the corresponding
character in the second argument, so you would be replacing
each tab with _one_ space character.
You could do it with sed, like
cat somefile | sed 's/<tab>/ /'
where "<tab>" means a real tab character, if you manage to
get it there...
Anyway, you would still lose the idea of tabs as fixed tab
stops, where each tab means "jump to the next tab stop".
As David wrote, expand will take care of this.
Tom