Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经看到这样做了,我曾经能够做到。我将它记录在最近在备份问题中被破坏的文件中。
我有一个要使用 lpr 从 bash 打印的文本字符串。我知道我可以轻松地打印文本文件,但是如何在不先将其保存为文件然后打印文件的情况下打印仅在引号或字符串中的文本?
您可以将此处的字符串与bash一起使用
lpr <<< "text string"
或者如果您的字符串包含在变量中
lpr <<< "$var"