Sample Header Ad - 728x90

Check which entry is empty with yad or zenity

1 vote
1 answer
291 views
I'm trying to create an array of four elements using a form consisting of 4 entries: new_prop=($(zenity --forms --title="my-script" --text="Insert the values" --separator=" " \ --add-entry="Name" \ --add-entry="Surname" \ --add-entry="Gender" \ --add-entry="Age")) In general, the user can leave the Gender field empty, but the other 3 must be filled. The problem is that zenity (I don't know yad) doesn't create an empty element if an entry is left empty, but simply it skips that element. For example, if I insert Name and Age, zenity makes an array new_prop of 2 elements. How can I check if an entry in the form is left empty? It doesn't matter if the form is made with zenity or yad. Thank you!
Asked by user9952796 (81 rep)
May 3, 2023, 03:01 PM
Last activity: May 4, 2023, 10:07 AM