I am working on a bash script and I want to print two files side by side. One file is populated with IPv4 addresses, and the other is populated with IPv6 addresses. I tried,
pr -mtw $WIDTH $FILE1 $FILE2
but he turned off the output.
โโโโโโคIPV4โโโโโโโฌโโโโโโโโโโโโโโโโโโคIPV6โโโโโโโโโโโโโโโโโโ 224.0.0.1 2001:0db8:0000: 192.0.2.128 ff02::1 192.0.2.128 2001:0db8:0000: 192.0.2.128 :: 2001:0db8:0000: 2001:db8:0:0:0: 2001:db8::ff00: 0000:0000:0000: ::1 fe80:: ::ffff:192.0.2. ::192.0.2.128
I also tried
paste $FILE1 $FILE2 | awk '$1=$1' OFS='\t '
and there was a way out
โโโโโโคIPV4โโโโโโโฌโโโโโโโโโโโโโโโโโโคIPV6โโโโโโโโโโโโโโโโโโ 224.0.0.1 2001:0db8:0000:0042:0000:8a2e:0370:7334 192.0.2.128 ff02::1 192.0.2.128 2001:0db8:0000:0000:0000:ff00:0042:8329 192.0.2.128 :: 2001:0db8:0000:0000:0000:ff00:0042:8329 2001:db8:0:0:0:ff00:42:8329 2001:db8::ff00:42:8329 0000:0000:0000:0000:0000:0000:0000:0001 ::1 fe80:: ::ffff:192.0.2.128 ::192.0.2.128
I want the result to be something like
โโโโโโคIPV4โโโโโโโฌโโโโโโโโโโโโโโโโโโคIPV6โโโโโโโโโโโโโโโโโโ 224.0.0.1 2001:0db8:0000:0042:0000:8a2e:0370:7334 192.0.2.128 ff02::1 192.0.2.128 2001:0db8:0000:0000:0000:ff00:0042:8329 192.0.2.128 :: 2001:0db8:0000:0000:0000:ff00:0042:8329 2001:db8:0:0:0:ff00:42:8329 2001:db8::ff00:42:8329 0000:0000:0000:0000:0000:0000:0000:0001 ::1 fe80:: ::ffff:192.0.2.128 ::192.0.2.128
FILE1:
224.0.0.1 192.0.2.128 192.0.2.128 192.0.2.128
FILE2:
2001:0db8:0000:0042:0000:8a2e:0370:7334 ff02::1 2001:0db8:0000:0000:0000:ff00:0042:8329 :: 2001:0db8:0000:0000:0000:ff00:0042:8329 2001:db8:0:0:0:ff00:42:8329 2001:db8::ff00:42:8329 0000:0000:0000:0000:0000:0000:0000:0001 ::1 fe80:: ::ffff:192.0.2.128 ::192.0.2.128
Note that there is a space at the beginning of each line. Any ideas?
source share