Hi everyone and thank you in advance! I used to run the following script with ncat Version 5.51 and it gave me wonderful formatting
[root@server user]# for i in "cat server_list" ; do echo $i | tr '\n' '\t' ; nc -zv $i 22 ; done
host1 Connection to host1 22 port [tcp/ssh] succeeded!
host2 Connection to host2 22 port [tcp/ssh] succeeded!
host3 Connection to host3 22 port [tcp/ssh] succeeded!
But since we needed to decomm all RHEL6 servers, I'm now getting this unwanted output when running the exact same script in RHEL7 using ncat Version 7.50
[root@server2 user]# for i in "cat server_list" ; do echo $i | tr '\n' '\t' ; nc -zv $i 22 ; done
host1 Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to IP.
Ncat: 0 bytes sent, 0 bytes received in 0.01 seconds.
host2 Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to IP.
Ncat: 0 bytes sent, 0 bytes received in 0.01 seconds.
host3 Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to IP.
Ncat: 0 bytes sent, 0 bytes received in 0.01 seconds.
Is there a way to get the same formatting as how I used to get since it greatly improves readability for me? Tried redirecting left and right but no dice.
Thank you so much and any advice is appreciated!
ncs are different programs. See this answer.