change file to unix or dos format

发表于:2007-07-04来源:作者:点击数: 标签:
change file to dos format or unix format

#!/bin/bash#author by luwe.net@hhstu.edu.cn#Apr 27 2005#for change file to unix format or change to dos format.:while getopts ud optiondo case $option in u) cat | sed 's/^M$//' > .unix &;; #M by Ctrl+V,Ctrl+M d) cat | sed 's/$'''/`echo \\r`/''> .dos &;; *) "echo Usage:./cinput filename {unix | dos}" esacdone

原文转自:http://www.ltesting.net