Create new strings
I have a text files with lines like this:
boat
hou开发者_如何学运维se
car
I would like to create a new file which looks like this:
boat.mydomain.com
house.mydomain.com
car.mydomain.com
How can I do this using sed? Thanks
sed 's/.*/&.mydomain.com/' input_file >output_file
As Felix Kling pointed out, this works, too:
sed 's/$/.mydomain.com/' input_file >output_file
$ cat file
boat
house
car
$ sed -r 's/(.*)/\1.mydomain.com/' file
boat.mydomain.com
house.mydomain.com
car.mydomain.com
精彩评论