Friday, April 4, 2014

appending string after end of each line

I have a File that contains list of servers and I just want to append a domain-name (say ) at the end of line.

# head -5 serverlist.txt
# sed  -ie 's/$/' serverlist.txt
# head -5 serverlist.txt

Another method using Awk:
awk '{ print $0 "" }' < serverlist.txt > resultfile.txt

No comments:

Post a Comment

Popular Posts

About Me

My photo
I have started this blog to share my work experience and spread some smart solutions on Linux to Internet community. I'm hoping more people will get benefited from this blog. Brief about me: I have 14+ years experience working as System Admin and currently work with VMware.