bug-coreutils
[Top][All Lists]
Advanced

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

Re: coreutils / fmt: adding newline at end of paragraph


From: Paul Eggert
Subject: Re: coreutils / fmt: adding newline at end of paragraph
Date: 29 Oct 2003 09:22:25 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Karl Eichwalder <address@hidden> writes:

> Dealing with paragraphs consisting of just one long line a feature to
> add a newline at the end would be handy.  At the moment I'm using this
> command to turn DOS like files into files following unix conventions:
> 
>     tr -d '\15' <$f | sed 's/\([[:alnum:]].*\)$/\1\n/' | fmt
> 
> There is probably a better way to accomplish such a job.

fmt -s does part of what you want.

It sounds like you'd like another convenience option to fmt, an option
that causes fmt to behave as if every nonempty pair of adjacent input
lines was separated by an empty line.  If we call that option -e, say,
then "tr -d '\15' <$f | fmt -e" would do what you want.  -e would
imply -s.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]