procmail
[Top] [All Lists]

Re: Ways to check for CRLF? (Was: Error???)

2003-06-13 07:28:23
Nancy,

On Fri, Jun 13, 2003 at 11:39:00AM +0100, Nancy McGough wrote:
I suggest that people use the Unix 'file' command to see if a file
contains a CRLF. Unfortunately not all versions of 'file' support
this. Does anyone have suggestions for easy ways for a newbie to find
out if a file contains a CRLF?

What about od piped through fgrep?

    $ od -c crlf | fgrep '\r'
    0000000   h   e   l   l   o  \r  \n   b   y   e  \r  \n

    $ od -c lf | fgrep '\r'
    $

Or, just fgrep if you are willing to deal with explaining how to enter a
"^M" to the shell:

    $ fgrep '^M' crlf 
    hello
    bye

    $ fgrep '^M' lf
    $

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>