Run applications from a "Run Command" box?

Place to discuss Fedora and/or Red Hat

Run applications from a "Run Command" box?

Postby Ice9 » Tue Apr 22, 2003 3:45 pm

I downloaded Trackballs (http://trackballs.sourceforge.net/), untarred the file to a test directory.
To run the game you just have to execute a shell script "run-trackballs" from within the directory, this works.

I'd like to be able to run the game just by hittin Alt+F2 and typing the name of the game (I start most of my apps like this).
When I installed Limewire I made a symlink for the shell script in /usr/bin and I'm able to start it by doing Alt+F2 and typing Limewire in the box.

I tried the same here but got this
Code: Select all
/usr/bin/run-trackballs: line 4: ./trackballs: No such file or directory


This means there is no hidden "configuration dir" in my home directory, but is there any way to make this work even without the presence of a ./trackballs directory?

thanks.
Ice9
guru
guru
 
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium

Postby Void Main » Tue Apr 22, 2003 3:52 pm

Without actually seeing the script or knowing any more about the software installation in question, it would appear to me that when you run the start script it is expected you are changed into a specific directory that contains the subdirectory "trackballs". If you created a symbolic link to a script then you might want to modify the script to change to the appropriate directory right off. Another option is to write a new script and place in /usr/bin rather than using a symbolic link and in that script you would have it change to the appropriate directory and then execute the appropriate command to start the program. Or am I misunderstanding the situation?
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Ice9 » Tue Apr 22, 2003 4:11 pm

This is the script actually
Code: Select all
#!/bin/bash
#export SDL_AUDIODRIVER=dma
export GUILE_LOAD_PATH=./share/guile/1.6.0
./trackballs $@


Am I missing something here?
There IS a ./trackballs directory, so why the error message?
Ice9
guru
guru
 
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium

Postby Void Main » Tue Apr 22, 2003 4:21 pm

Edit that script and add "cd /directory/that/contains/trackballs" right after the line that starts with "#!".
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Ice9 » Tue Apr 22, 2003 4:25 pm

It works, thanks Void.
Time to actually learn a few things about scripting I guess :)
Ice9
guru
guru
 
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium

Postby Void Main » Tue Apr 22, 2003 4:36 pm

Basically what was happening is when you run a script from the ALT+F2 run box your current working directory will be your $HOME directory. The line in that script is executing "./trackballs". That means that the "trackballs" script must reside in the current working directory and since the "trackballs" script doesn't reside in your $HOME directory you will get a file not found error. To solve that you change to the directory that contains the "trackballs" script first (which changes your current working directory) or change "./trackballs" to "/full/path/to/trackballs". Now that may or may not work as the "trackballs" script or program may be expecting certain things relative to the current directory so what I suggested was probably the easiest thing to do in this situation.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 1 guest

cron