[nycbug-talk] Scripting Question

Okan Demirmen okan at demirmen.com
Fri Mar 9 13:37:58 EST 2007


On Fri 2007.03.09 at 13:12 -0500, Kevin Reiter wrote:
> ----- opriginal message -----
> The second example worked like a charm:
> 
> tr '\n' , < host-ports | sed 's/,$//' > $port_temp
> 
> That did the trick, aside from rewriting the line in .nessusrc with the output, which I can I can do in a minute or two..
> 
> Thanks!
> 
> ------------------------------
> (yeah, Outlook sucks :)
> 
> Follow-up question:  Is there a quick and dirty way to check for duplicate entries, and eliminate them if they exist?
> 
> For example:
> 
> 1
> 1
> 2
> 3
> 3
> 3
> 4
> 5
> 
> I need: 1,2,3,4,5
> 
> Is there a quick check/solution for this?

there are tons, here is one:
cat host-ports |sort|uniq|xargs|sed 's/ /,/g'
cat host-ports |sort -u|xargs|sed 's/ /,/g'



More information about the talk mailing list