Imaginge input file:

– dev-env1-service-202.domain.com
– dev-env1-service-203.domain.com
– dev-env1-service-204.domain.com
– dev-env1-service-205.domain.com
– dev-env1-service-206.domain.com
– dev-env1-service-207.domain.com
– dev-env1-service-208.domain.com
– dev-env1-service-209.domain.com
– dev-env1-service-210.domain.com

and you would like to have it in form:

dev-env1-service-202.domain.com dev-env1-service-203.domain.com dev-env1-service-204.domain.com dev-env1-service-205.domain.com dev-env1-service-206.domain.com dev-env1-service-207.domain.com dev-env1-service-208.domain.com dev-env1-service-209.domain.com dev-env1-service-210.domain.com

Just run commands:

cat file.txt |sed -e s/’ – ‘/”/g|sed -e s/’ ‘/”/g| tr ‘\n’ ‘ ‘

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s