> In Solaris 2.6, I would like to search text files in multiple directories
> for the remainders of PC carriage returns (^M) using something along the
> lines of :
> find . -exec grep '^M' {} \;
Is the thing between the quotes a two character sequence (a caret
followed by an M), or is it a single character (control-M)?
As a single character, that looks a little close, but I'd do it this
way.
find . -type f -exec grep -l '^M$' {} +
In my directory, that finds some binaries and a lot of pdf files. Using
grep in this manner shows you a file with even one hit. It would be
nicer if it could show a file only if a certain percentage of the lines
in the file matched. I think I could do something pretty good in perl,
but it wouldn't be a one-liner.
--
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >