I'd like to be able to capture the version of x2goclient in a script and report it back to the user externally. Use case for this would be an external info dialog when running x2goclient in a thin client environment. Bash script would look something like this:
#!/bin/bash VER=$(x2goclient --version) echo Your version is $VER
The client generates lots of additional info and warning messages to stderr, which I can suppress using grep -v. I can get a clean version number if I call it standalone on the cli: $ x2goclient --version 2>&1 | grep -v x2go When I do this, however, I get "Terminated" added to the output.
But as soon as I try to capture the output in a subshell per the first snippet, the client can't get the tty and so opens the GUI About dialog. I've tried using the --hide option, but this doesn't help.
I would like to just be able to invoke the client and get just the version number with no additional output. I could just query the OS package manager to get the installed version, but this doesn't give an accurate result if I'm running from a binary I've compiled from source. I'm working on hacking the code to get the result I want, but wonder if there is an easier solution.
Any suggestion? Please let me know.
Thanks. Seth
-- Seth Galitzer Systems Coordinator Computing and Information Sciences Kansas State University http://www.cis.ksu.edu/~sgsax sgsax@ksu.edu 785-532-7790