Open (unknown) text editor from bash script?

For use in a bash script, is there a generic command for opening a file in the (GUI) text editor across distros/regardless of which one is installed? If not, how would you handle this?
Using a case statement and checking for the existence of gedit/xed/kate/etc.?

Look into xdg-open. It can open file as per defaults.

xdg-open /path/to/file

Does this helps?


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki