这里假设原来的dos系统文件为dos.txt,修正后的unix系统文件名为unix.txt,利用标准的输入输出命令:
代码: 全选
# tr -d '\r' < dos.txt > unix.txt
在OpenBSD下进行一下文件对比,源文件dos.txt
代码: 全选
<if condition="$show['lastpostinfo']">[color=red]^M[/color]
<div class="smallfont" align="$stylevar[align=left]">[color=red]^M[/color]
<div>[color=red]^M[/color]
<span style="white-space:nowrap">[color=red]^M[/color]
<if condition="$show['icon']"><img class="inlineimg" src="$icon[iconpath]" alt="$icon[title]" border="0" /></if>[color=red]^M[/color]
<if condition="$lastpostinfo['prefix']">[color=red]^M[/color]
$lastpostinfo[prefix][color=red]^M[/color]
</span><if condition="is_browser('safari')"><!--bug#24775--> </if>[color=red]^M[/color]
<span style="white-space:nowrap">[color=red]^M[/color]
</if>[color=red]^M[/color]
<a href="showthread.php?$session[sessionurl]goto=newpost&t=$lastpostinfo[lastthreadid]" style="white-space:nowrap" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpo$
</div>[color=red]^M[/color]
<div style="white-space:nowrap<if condition="is_browser('ie', 6)">; float:$stylevar[align=left]</if>">[color=red]^M[/color]
<phrase 1="member.php?$session[sessionurl]find=lastposter&f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase>[color=red]^M[/color]
</div>[color=red]^M[/color]
<div align="$stylevar[align=right]" style="white-space:nowrap">[color=red]^M[/color]
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>[color=red]^M[/color]
<a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]#post$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>[color=red]^M[/color]
</div>[color=red]^M[/color]
</div>[color=red]^M[/color]
<else />[color=red]^M[/color]
<div class="smallfont" align="$stylevar[align=right]">[color=red]^M[/color]
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>[color=red]^M[/color]
<a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>[color=red]^M[/color]
</div>[color=red]^M[/color]
</if>
Unix.txt
代码: 全选
<if condition="$show['lastpostinfo']">
<div class="smallfont" align="$stylevar[align=left]">
<div>
<span style="white-space:nowrap">
<if condition="$show['icon']"><img class="inlineimg" src="$icon[iconpath]" alt="$icon[title]" border="0" /></if>
<if condition="$lastpostinfo['prefix']">
$lastpostinfo[prefix]
</span><if condition="is_browser('safari')"><!--bug#24775--> </if>
<span style="white-space:nowrap">
</if>
<a href="showthread.php?$session[sessionurl]goto=newpost&t=$lastpostinfo[lastthreadid]" style="white-space:nowrap" title="<phrase 1="$lastpostinfo[lastthread]">$vbphrase[go_first_unread_in_thread_x]</phrase>"><strong>$lastpo$
</div>
<div style="white-space:nowrap<if condition="is_browser('ie', 6)">; float:$stylevar[align=left]</if>">
<phrase 1="member.php?$session[sessionurl]find=lastposter&f=$lastpostinfo[forumid]" 2="$lastpostinfo[lastposter]">$vbphrase[by_x]</phrase>
</div>
<div align="$stylevar[align=right]" style="white-space:nowrap">
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
<a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]#post$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</div>
</div>
<else />
<div class="smallfont" align="$stylevar[align=right]">
$lastpostinfo[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$lastpostinfo[lastposttime]</span></if>
<a href="showthread.php?$session[sessionurl]p=$lastpostinfo[lastpostid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</div>
</if>
源文件的基本内容并没有变化,尺寸小了,在OpenBSD下看得也舒服多了。
代码: 全选
# ls -la
....
-rw-r--r-- 1 root wheel 1899 Mar 15 23:23 dos.txt
-rw-r--r-- 1 root wheel 1874 Mar 15 23:22 unix.txt