因为我需要翻译一些自己的东西,所以,写了个简单的脚本,把man文件导出文本到txt文件,然后再进行翻译
代码如下:
#!/bin/sh
echo "I will save the man command to file"
man $1 | col -b > /home/master/man_chinese/$1.txt
if [ -f /home/master/man_chinese/$1.txt ]
then
echo "successed"
else
echo "fail"
fi
chmod 664 /home/master/man_chinese/$1.txt
chown master /home/master/man_chinese/$1.txt