[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [textutils-2.0] [od] feature suggestion
From: |
Jim Meyering |
Subject: |
Re: [textutils-2.0] [od] feature suggestion |
Date: |
Thu, 11 Oct 2001 20:50:56 +0200 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.107 |
"Roth, Kevin P." <address@hidden> wrote:
> My platform:
>
> $ uname -a
> CYGWIN_NT-5.0 FDYP143578 1.3.3(0.46/3/2) 2001-09-12 23:54 i686 unknown
>
> I was attempting to get od to output hex characters and ascii characters lined
> up on top of each other, like so:
>
> 0000000 t h i s i s l i n e o n e
> 74 68 69 73 20 69 73 20 6c 69 6e 65 20 6f 6e 65
>
> but the closest I could get seemed to be:
>
> $ od -tcx1 filename
> 0000000 t h i s i s l i n e o n e
> 74 68 69 73 20 69 73 20 6c 69 6e 65 20 6f 6e 65
Thanks for the suggestion, but
how about just filtering the od output through a little sed filter instead:
$ printf 'this is line one\nline two\n'|od -tcx1|sed '/^[0-9]/s/ \( .\)/\1/g'
0000000 t h i s i s l i n e o n e
74 68 69 73 20 69 73 20 6c 69 6e 65 20 6f 6e 65
0000020 \n l i n e t w o \n
0a 6c 69 6e 65 20 74 77 6f 0a
0000032