質問

I know this command will paste the clipboard contents into a file:

xclip -out -selection clipboard >> file.txt

If I want to paste clipboard content into a variable like a string what do I do?

役に立ちましたか?

解決

To assign the output of a command to a variable, you can use command substitution:

myvar=$( command )
echo "$myvar"
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top