[Ilugc] Help on Vi Editor

  • From: linux@xxxxxxxxxxxxxxxx (Suresh Ramasubramanian)
  • Date: Tue Mar 15 09:36:32 2005

Sridhar Ratna <sridharinfinity@xxxxxxxxx> wrote:

On 14 Mar 2005 18:37:50 -0000, RAJ <rajkumar_chunkymails@xxxxxxxxxxxxxx>
wrote:
  Dear sir,
        I'm having a file with list of users (one user per line) , i want
        to append an domain name (eg: @somedomain.com) to each line , can
        anyone help me out to do this.

I don't know about VI, but it can be simply done with shell 
for x in `cat usersfile`; do echo "$x@xxxxxxxxxx"; done
redirect that to a new file

Just plain sed operation

Something like 

%s/$/@domain.com/g

Other related posts: