Em um projeto semelhante que eu criei, este funcionou bem para mim:
export TMPFILE=/tmp/yadvalues
function listselect {
echo "Args Received = $0, $1 , $2 , $3 , $4 , $5" #Display args send to function
echo -e "FILEID=\"$1\"\nFILENAME=\"$4\"\nFILECOMMAND=\"$5\"" > $TMPFILE
# Save some of the args in file
}
#export -f listselect
function filedisplay {
source $TMPFILE
ftd=$(yad --title="File Display-$FILENAME" --width=800 --height=500 \
--center --text-info --filename=$FILENAME --wrap --editable \
--button="Go Back":0)
# Use var $FILENAME present in $TMPFILE
}
#export -f filedisplay