UNIX / Linux Convert DOS Newlines CR-LF to Unix/Linux Format

patchremoveBomb(^M)

$ cat ~/bin/rmBom 

#! /bin/sh¬
¬
#echo "uconv --remove-signature the $1 files"¬
¬
### uconv not availble¬
#    find . -name "*.$1" \¬
#    -exec uconv --remove-signature {} -o {}.nobom \; \¬
#    -exec mv {}.nobom {} \;¬
¬
### ¬
# Convert DOS newlines (CR/LF) to Unix format using sed command¬
#¬
echo "Convert DOS newlines (CR/LF) to Unix format using sed command."¬
echo "sed 's/^M$//' $1 files ..."¬
¬
find . -name "*.$1" \¬
         -exec bash -c "sed 's/^M$//' {} > {}.sed;mv {}.sed {}" \;¬

HowTo:UNIX/LinuxConvertDOSNewlinesCR-LFtoUnix/LinuxFormat

相关推荐