Suppose for example I have script like this:
(The example depicts an rysnc use case)
#!/bin/bash echo -n "Enter Source Directory:" read srcdir echo -n "Enter Destination Directory:" read dstdir rsync -av --delete "$srcdir" "$dstdir"
The idea here is to prompt the user to enter the "Source" and "Destination" directories for rsync to work with. As is, the user will have to manually enter
/path/to/directory/ via the command-line.
Instead, I want to prompt the user to enter the paths through a GUI interface.
Something like this:
What commands can I use to prompt the user with a GUI selection window that returns the file path to the command-line?
Because If scripted file run directly (by double-click and not run in terminal) then I want to provide GUI selection window.