#!/bin/sh # *********************************************************************** # # * * # # * Copyright (c) 1996-1999 Scott Crevier * # # * All Rights Reserved Worldwide * # # * * # # * This program product material is the property of Scott Crevier. * # # * This program may be used and modified by anyone free of charge, * # # * as long as this copyright notice remains in tact. By using this * # # * code, you agree to indemnify Scott Crevier from any liability * # # * that might arise from its use. * # # * * # # * scott@crevier.org - Scott M. Crevier - www.crevier.org * # # *********************************************************************** # # * smcRmcr.sh v2.0 22-Dec-1998 * # # * * # # * To remove carraige-return characters from a file: * # # * * # # * smcRmcr.sh filename * # # * * # # *********************************************************************** # # *********************************************************************** # # * Verify that the file exists. * # # *********************************************************************** # if [ -f $1 ] then file=$1 else echo "Sorry, file not found '$1'." exit 1 fi # *********************************************************************** # # * Remove the ^M characters. * # # *********************************************************************** # tr -d '\015' < $file > $file.$$ mv $file.$$ $file