#!/bin/sh for file in $* do tr -d '\015' < $file > $$ if [ $? -eq 0 ] then mv $$ $file fi done