dos2unix
来自「AT91所有开发板的资料 AT91所有开发板的资料」· 代码 · 共 48 行
TXT
48 行
#! /bin/sh ## dos2unix - crude use of zip/unzip to convert LF to CR/LF#usage () {echo " Usage: dos2unix <filename> .. <filename>";echo " Converts a number of files from DOS (CR/LF) to Unix (LF)"exit 1 }convert () { echo "converting $FILE from DOS to Unix" zip -ll /tmp/$$.zip $FILE > /dev/null unzip -o /tmp/$$.zip > /dev/null rm -f /tmp/$$.zip}# check argcif [ $# = 0 ]then usagefi# do they need help?case "$1" in "-h" | "--help" | "-help") usage exit 1esac# check to see if there is a source fileFILE=$1if [ ! -f $FILE ] then echo "dos2unix: can't find $FILE" >&2 exit 1fi# convert the filesfor i in $*do FILE=$i convertdoneexit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?