Start C++ console app from shell file

Arch linux OS

1. I have compiled my program successfully.
2. Open Xterm - cd to proper directory which contains the executable and supporting data .txt files and the program runs smoothly.
3. Open gedit and entered


 
/usr/bin/xterm -fullscreen -e /home/k2/build-Pattern_football-Desktop-Debug/Pattern_football


and save it as pattern.sh

when i double click pattern.sh the pattern program opens - some correct data then quickly flashes up and then the xterm window disappears or exits.

After putting in some pauses I have discovered that it is not retrieving data from the .txt files?

All the .txt data files are in the /home/k2/build-Pattern_football-Desktop-Debug/ folder

what does one put in his shell so the needed data files are accessible???
Last edited on
I'll suppose that you are using relative paths, ┬┐what does `getcwd()' say?

As a convention, data files should be located in
$XDG_DATA_HOME.
$HOME/.local/share
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Last edited on
As soon as I read Relative Paths I put changed my shell file to
1
2
3
cd /home/k2/build-Pattern_football-Desktop-Debug/

/usr/bin/xterm -fullscreen -e /home/k2/build-Pattern_football-Desktop-Debug/Pattern_football


works like a charm
Topic archived. No new replies allowed.