[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: vi globally append question



From: Sean <hesselroad@yahoo.com>
Date: Thursday, July 15, 2004 8:49 am
Subject: vi globally append question

> hi all,
> 
> i have a file like;
> 
> #
> one
> 123
> 
> and i would like to APPEND a # at the beginning of
> each line which is not started with a # . how can i do
> it with vi or ed, so far, i 've tried;

This is neatest, I think

:g!/^#/ s/^/#/

Patrick. 



Reply to: