On 2005-05-09 12:21, cpghost <[EMAIL PROTECTED]> wrote:
>On Mon, May 09, 2005 at 12:34:08AM +0300, Giorgos Keramidas wrote:
>> No "tool" is needed, as long as you have FreebSD's shell, sed & grep:
>>
>>      $ find . | while read fname ;do
>>          if grep '^M' "${fname}" >/dev/null 2>&1 ;then
>>              sed -i '' -e 's/^M//g' "${fname}"
>>          fi
>>        done
>
> Wouldn't this also catch directories or special files with ^M in them?
> I'd add a "-type f" to find to avoid errors while trying to write to
> a directory:
>
> $ find . -type f | while read fname ;do
>     if grep '^M' "${fname}" >/dev/null 2>&1 ;then
>         sed -i '' -e 's/^M//g' "${fname}"
>     fi
>   done

Yes.  You're right, of course :-)

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to