سؤال

I have a script that makes a GUI list here:

zenity  --list --text="Choose action" --column= --hide-header opt1 opt2 opt3

How can I make this output be assigned to a variable?

هل كانت مفيدة؟

المحلول

OUT=$(zenity --list --text="Choose action" --column= --hide-header opt1 opt2 opt3)

This will assign the output to $OUT.

The $() operator performs Command Substitution, i.e. allows the output of a command to replace the command itself.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top