0

I am using Yad for a simple interface.

The problem I am having is that the standard output has the value of the User field if I press Enter in the field itself. However, if I press the "save" button, then there is nothing in the standard output.

Here is the script!

res=$(yad \
--width=600 \
--title="Config" \
--text="COnfiguration options" \
--form \
--field="User" \
--button="Save:1" \
--button="Cancel:2" \
--center)

ret=$?
echo $ret
echo $res
Merc
  • 16,277
  • 18
  • 79
  • 122

1 Answers1

0

I should learn how to read the last line of a man page...

Even exit code mean to print result, odd just return exit code.

Just do:

res=$(yad \
--width=600 \
--title="Config" \
--text="COnfiguration options" \
--form \
--field="User" \
--button="Save:2" \
--button="Cancel:1" \
--center)

ret=$?
echo $ret
echo $res

And I will get data with exit codes 0 and 2 -- which is what I want

Merc
  • 16,277
  • 18
  • 79
  • 122