I need to format port scan output for input into another app.
This is what I have;
1025/tcp
1521/tcp
2301/tcp
2381/tcp
3191/tcp
3389/tcp
5938/tcp
47001/tcp
54321/tcp
21/tcp
80/tcp
135/tcp
139/tcp
445/tcp
1025/tcp
I want to chop the "/tcp" off, run it through uniq so that I only have the unique ports and then stack the output like below comma separated
1521, 2301, 2381, 3191, 3389, 5938, 47001, 54321, 21
Thanks!