27.2 UNIX 轉成 DOS

ux2dos.pl

#! /usr/bin/perl

while (<>) {
	s/\012//;
	print $_ . "\n\r";
}

用例:


./ux2dos.pl ux-test.txt