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
相关推荐
zlsdmx 2020-05-14
eroshn 2020-05-11
zluxingzhe 2020-02-29
blncle 2020-02-11
xuanlvhaoshao 2020-01-23
wklken的笔记 2020-01-05
宿舍 2019-12-20
明月清风精进不止 2019-10-23
houdaxiami 2019-03-25
jsoncorleone 2016-02-25
kekekid 2010-04-04
宁静致远 2009-06-09
timewind 2019-07-01
jsqip 2019-07-01
UsherOu 2013-02-25
静心斋 2016-03-11
ScarletLina 2011-04-09
superhosts 2019-06-26