I have written a program to find the open ports of a given IP. since the print function is in a loop my output format is like this:
IP1,22
IP1,23
IP1,24
IP2,25
IP2,26
IP3,27
IP3,30
IP3,45
How do I get it in this format:
IP1,22,23,24
IP2,25,26
IP3,27,30,45
EDIT: this is what I have done so far
awk'{a[$1]=(a[$1])? a[$1]r : r }
but I dont know how to progress forward from here.