I'm trying to set up a bash script to run GAP with a preloaded workspace. This in itself is not to bad:
Code:
#! \bin\bash
/usr/local/bin/gap -L /usr/local/gap/qgap
However.. I'd like for it to be a little smarter. From a virtual terminal or remote login, I'd like it to use the
/usr/local/gap/qgap_console and from an X session I would like it to load
/usr/local/gap/qgap.
Sure I could just make 2 scripts and then have to remember which one to run.. but I'd rather make it choose seemlessly.
Any ideas how to do this? Sure I can set up a conditional.. the tricky part is knowing the right variable to see if I'm in X or not.
-Q