如何在 macOS 上使用命令行解码引用的可打印文件?

sun*_*sen 5 command-line macos

我知道可以使用 JavaScript 或 PHP 来完成,但是有命令行实用程序吗?

gle*_*man 10

Perl 一行:

echo "$input" | perl -MMIME::QuotedPrint -0777 -nle 'print decode_qp($_)'
Run Code Online (Sandbox Code Playgroud)

MIME::QuotedPrint 是一个核心 perl 模块,因此无需任何额外安装即可工作。


小智 5

对于 Python 3.x:(在 Cygwin 上测试)

python -c 'import sys,quopri;quopri.decode(sys.stdin,sys.stdout.buffer)' < infile > outfile
Run Code Online (Sandbox Code Playgroud)