I think you want "\cM". The pattern you listed would match a tab followed
by <M>. The \c meta symbol and the next character match the coresponding
control character. (ie. \cI matches ^I (tab)).

perl -ne 'print if m/\cM/' file-to-check.txt

would print each line with a control-M.

On Thu, 21 Jun 2001, Jeanne Riley wrote:

> Date: Thu, 21 Jun 2001 07:17:04 -0400
> From: Jeanne Riley <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Detecting NT eol (^M) characters
>
> Hi,
>
> I am attempting to write my 1st Perl script.  I have an install of ClearCase
> 4.1 which has Perl embedded in it.  I need to write a Perl script (trigger)
> that if anyone attempts to check in a file with NT eol character the check
> in will be blocked.  The Perl script needs to detect if there are any NT eol
> or ^M characters in a file.  I am "cat" the file and know I need to grep for
> ^M but I don't know how to do this in Perl.  I did seek assistance from
> www.perl.org and found information regarding "\cI<M>" but this does not seem
> to work.
>
> Has anyone tried to do this before?
>
> Any and all assistance will be greatly appreciated.
> Jeanne
>

 Eric Wisti
 Kinetic, Inc.
 (651) 848-0477

Reply via email to