質問

I've seen this done and I used to be able to do it. I had it documented in a file that was clobbered recently in a backup issue.

I have a text string I want to print from bash using lpr. I know I can print text files easily, but how can I print text that is just in quotation marks or in a string without first saving it as a file, then printing the file?

役に立ちましたか?

解決

You could use here-strings with

lpr <<< "text string"

or if your string is contained in a variable

lpr <<< "$var"
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top