So basically I have a text like this:
[ 4] .init PROGBITS 080481c0 0001c0 00002e 00 AX 0 0 4
[ 5] .plt PROGBITS 080481f0 0001f0 000110 00 AX 0 0 16
[ 6] .text PROGBITS 08048300 000300 07c95c 00 AX 0 0 16
[ 7] __libc_thread_fre PROGBITS 080c4c60 07cc60 000076 00 AX 0 0 16
[ 8] __libc_freeres_fn PROGBITS 080c4ce0 07cce0 000b2f 00 AX 0 0 16
[ 9] .fini PROGBITS 080c5810 07d810 00001a 00 AX 0 0 4
[10] .rodata PROGBITS 080c5840 07d840 019774 00 A 0 0 32
[11] __libc_thread_sub PROGBITS 080defb4 096fb4 000004 00 A 0 0 4
[12] __libc_subfreeres PROGBITS 080defb8 096fb8 00002c 00 A 0 0 4
[13] __libc_atexit PROGBITS 080defe4 096fe4 000004 00 A 0 0 4
What I'm trying to get is the following:
.init 080481c0 0001c0 00002e
.plt 080481f0 0001f0 000110
.text 08048300 000300 07c95c
__libc_thread_fre 080c4c60 07cc60 000076
__libc_freeres_fn 080c4ce0 07cce0 000b2f
.fini 080c5810 07d810 00001a
.rodata 080c5840 07d840 019774
__libc_thread_sub 080defb4 096fb4 000004
__libc_subfreeres 080defb8 096fb8 00002c
__libc_atexit 080defe4 096fe4 000004
I tried something like this:
awk '/PROGBITS/ {print $2,$4,$5,$6} '
but the problem [ 4]is there is a space inside , which means that in the line 4-9I have to use
awk '/PROGBITS/ {print $3,$5,$6,$7} '
Can I use the single command when getting all the columns that I want?
source
share