LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   command not found error (https://www.linuxquestions.org/questions/linux-newbie-8/command-not-found-error-338192/)

lordshipmayhem 06-28-2005 08:01 PM

command not found error
 
I'm trying to learn how to set up programs using the old .tar method. I decide to try with a fairly simple game, "Bubble Shooter", which Absolutist has ported to Linux. (The Readme for this sucker assures me that it'll run in a number of distros, including my own Mandrake.)

http://absolutist.com/linux/bubbles/bshooter.tgz

So far, so good.

The Readme file contains the following instructions:

1) copy the file to a directory of your choice
2) unpack the archive:
tar xzvf bshooter.tgz
3) go into BubbleShooter directory and run the game:
cd BubbleShooter;
bubbles

Seems simple enough. (Yes, you could be describing the person starting this thread...)

So I copy the file into usr/share/bubbleshoot (error #1: now I have a directory usr/share/bubbleshoot/BubbleShooter, when if I'd just copied it into usr/share it would have been enough... but then, this IS a learning exercise). In the BASH shell, I su into root, copy-and-paste the tar command from the Readme file to be sure I don't mistype anything, and execute the command. So far, so good - everything seems to be set up as advertised in the Readme file. I then cd into BubbleShooter and type "bubbles".

bash: bubbles: command not found

And I did what wrong, please?

I'm sure whatever it is, it's probably pretty simple and so obvious most "howto"'s skip this...

bigdog0007 06-28-2005 08:17 PM

Try going to the directory and typing in ./bubbles

lordshipmayhem 06-28-2005 09:10 PM

And that worked. Thanks a lot!!

Usually I find, the problem has a simple solution.

nevarlen 06-28-2005 09:12 PM

If the above did not help, make sure to chmod +x the bubbles file you are trying to fire up. Once you get it working , it is also a good idea to create an alias for bubbles to that link to the /path/to/bubbles so next time you do not have to cd into that directory to get it working..
hope this helps..
----------------------------------------------------------------
looks like you type faster than I do..glad it worked though..

bigrigdriver 06-28-2005 09:15 PM

Bash is a very powerful scripting language, among other things. But, it's also dimwitted. You have to tell it where the executable file is located.

There are two ways to do that.

1) give the full path to the executable: as in /usr/share/bubbleshoot/BubbleShoot, and away it goes.

2) use shorthand. cd to the directory in which the executable is located, and tell bash 'it's in this directory', using bash shorthand: ./

The ./ tell bash the executable is in the pwd (present working directory: that's where you are when you cd to a directory).

3) the final option. the executable is not in your path (see /etc/ld.so.config to see which directories are in ALL users paths). Just edit that file to add the path to a directory which contains an executable you want all user to be able to use. There's a way to temporarily (i.e. this login) add a path to your users privileges: something like 'export PATH=$PATH:/usr/share/bubbleshoot/BubbleShoot', which adds the BubbleShoot executable to your path for this login only. Add it to /etc/ld.so.config to make it permanent, for all users.

After you edit that file, it probably won't work. And you'll think I don't know what I'm talking about. Until you restart the X server, or reboot. That's because, when you edit a config file, the changes don't take effect until you do 1 of 3 things: reboot, restart the X server (ctrl-alt-backspace), or........

issue the bash command: source /etc/ld.so.conf. That tells bash to reload the config file. Or, you could use the shorthand version of the same command: . /etc/ld.so.conf. Notice the dot followed by a space before /etc/ld.so.conf. The dot (.) is bash-speak for 'source'. They have the same meaning: reload the config.


All times are GMT -5. The time now is 07:47 PM.