A formatting query

Rob Weir rweir at ertius.org
Thu Feb 13 21:37:23 EST 2003

On Sat, Feb 08, 2003 at 07:46:23AM +1100, Kim Holburn wrote:
> At 8:26 AM +1100 2003/02/07, Felix Karpfen wrote:
> >Matthew Hawkins wrote:
> >> Felix Karpfen (felixk at webone.com.au) wrote:
> >> > Is there a <search-and replace routine|vim plugin> that will
> >> > convert a formatted text file from the Unix to the DOS format?  I
> >> > have a hazy recollection that one uses NL and the other uses
> >> > NL/CR.
> >>
> >> :set ff=dos :w
> >
> >The wonderful thing about Linux is that there are always at least six
> >different ways of strangling the bull.
> >
> >I tried this one first - because it is well within my current
> >computing abilities.  It worked like a charm and solved my immediate
> >problem.
> >
> >Pushing my luck and looking further, the full challenge is to convert
> >a downloaded .html file to a formatted DOS text file.  At the moment
> >this is a two-stage operation:
> >
> >1) w3m -dump file.html > file.txt; and
> >
> >2) load file.txt (w3m retains the formatting) into vim and run the
> >above routine.  If that can be done easily in one hit, I would be
> >glad to know.
> 1) I think you can make a copy of ~/.vimrc from your home directory
> and add a line with ":set ff=dos" and put it in the directory with the
> file where vi(vim) should pick it up - but you'll still have to open
> and close vi.

This doesn't seem to work here (latest vim from sid, 6.1-320+1).
Doesn't that sounds like a massive security hole though, given that vim
scripts can execute arbitrary commands?  Imagine if I drop one in a
source tarball, or even in /tmp, and convince root to open a file there
with vim...

Rob Weir <rweir at ertius.org>				http://ertius.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20030213/f3ec8dad/attachment.bin

More information about the linux mailing list