I am using an if statement to run a different response for each option selected in a yad GUI (zenity fork). For some reason the if statement works with some options and not with others!? *note I'm substituting '^' for '`' in the example
opt=^yad --list --column="Option" --column="Description" \ 1 "option 1" \ 2 "option 2 <i> subtext </i>" \ | cut -c 1^ echo $opt if [[ $opt == 1 ]] then echo 1 elif [[ $opt == 2 ]] then echo 2 else echo error
option one gives: 1 1 option 2 gives: 2 error. The variable is being recorded right as is evident by the "echo $opt" output. I know it has something to do with the subtext, if I erase it the problem goes away, but as to why I have no idea. Can anyone help me with a fix, or suggest a workaround? Thanks for all of your help! This problem is really stumping me.
Aucun commentaire:
Enregistrer un commentaire