ascii nulls, awk, and tr

From: Gerard C Blais (gerard.blais_at_mci.com)
Date: 08/03/04


Date: Tue, 03 Aug 2004 15:33:30 -0400


I have text files that may contain ascii nulls.

I'd like to delete the null characters.

I also have a lot of other things to do to the rows, and I'm doing
them in awk already, so adding something to an awk script would be a
nice way to go.

None of the awks on my Solaris (/usr/bin/awk, /usr/xpg4/bin/awk,
/usr/bin/nawk) recognize ascii nulls. Someone suggested mawk, and I'm
trying to get that installed. If anyone knows if mawk will or won't
work, I'd be interested.

Meanwhile, it seemed like a perfect fit for tr.

BUT, if I try tr -d \000 null.txt > null.nonull,

tr just hangs, and there is no output. null.txt is a 3 line file
with nulls in the middle of line 2.

Any ideas?

Thanks,

Gerry