RE: vi globally append question
> -----Original Message-----
> From: Sean [mailto:hesselroad@yahoo.com]
> Sent: Thursday, July 15, 2004 9:49 AM
> To: debian-user
> 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;
>
> :%s/^[a-z]:[0-9]/#/g
>
> but this would CHANGE the first character of each line
> to a hash, pls help.
>
> thks in advance.
>
>
Try something like:
%g!/^#/s/^/#/
My notation may be a bit screwed up, but this approach should do it
--
David
Reply to: