Compressing a two columned list
I have a list of instances in a server cluster and their matching hostname:
Code:
CLUSTER-A HOST1 Code:
CLUSTER-A HOST1 HOST2 HOST3 HOST4 From my searches (tough to search for something I can't put a name to), I couldn't find much. But I'm sure this is a common issue. |
Try:
Code:
#!/bin/sh NOTE: This assumes the input is sorted. Another note: I see your output has a "CLUSTER-B HOST1 HOST2 HOST3 HOST4", but the input has no such data. |
I was only putting in an example the . . were to imply further data, so your code works great and does exactly what is needed especially since I do a sort prior. Thanks much for your help!
|
All times are GMT -5. The time now is 09:35 PM. |