[Ilugc] Help on Vi Editor

  • From: binand@xxxxxxxxx (Binand Sethumadhavan)
  • Date: Tue Mar 15 07:17:53 2005

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 think this is possible with vi editor , do anyone know how do i do it.

In vim:

:%s/$/@somedomain.com/

In perl:

perl -pi -e 's/$/@somedomain.com/' filename

Create a backup of your file before you try anything!

Binand

Other related posts: