Please give a small example.
In principle it should work, but that depends very much on your code.
At least this should work:
Code: Select all
#!/bin/bash
echo 'apple pie
banana cake
peach ice' > /tmp/testo
res=$(yad --form --separator="\n" --field=1 --field=2 --field=3 --button="Save & Exit:0" --button=Cancel:1 < /tmp/testo)
(($?)) && exit #exit here if exit status of yad > 0 (Save&Exit button was not pressed)
echo "$res" > /tmp/testo #write back to file