문제

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