When I run this bash script below my results are all echoed on the same line, as "Example Output" below shows.
#!/bin/bash
Commander=$(nmap -vv -p 8080 xxx.149.xxx.100-xxx |
grep "Discovered open port 8080/tcp on" | sed -r 's/^.{32}//');
echo $Commander;
Example Output:
xx.149.xx.115 xx.149.xx.107 xx.149.xx.107 xx.149.xx.101 xx.149.xx.118 xx.149.xx.146
What I would like is:
xx.149.xx.115
xx.149.xx.107
xx.149.xx.107
xx.149.xx.101
xx.149.xx.118
xx.149.xx.146
xx.149.xx.19
Any, Suggestions??