Michael C. Toren on Mon, 18 Oct 1999 03:14:48 -0400 (EDT)


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

Re: [Plug] dos2unix???


Just a few quick comments...

> > cat <FileName> | tr -d '\r' > out; mv out <FileName>

The use of "cat" here is somewhat useless; instead, you can use input
redirection to achieve the same result.  Plus, you'll probably want to
check the return value of "tr" before blindly overwriting the input file.

A safer, more elegant approach using tr might be:

	tr -d '\r' < in > out && mv out in

> :1,$s/^V^M//g

When specifying a range in ex mode, you can use "%" instead of "1,$" to
represent the entire buffer.  i.e., :%s/^V^M//g

-mct