Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Is it possible to set up a shell to automatically include you current working directory in the PATH variable so I can execute programs that are in my current dirrectory?
Also, where is the best place to install a program? /usr/local ?
Basically I am trying to learn more about how to install a program. I have a copy of the Stuttgart Neural Network simulator but I don't know much about linux yet so I am having a lot of trouble installing it. It is in tar.gz form. I am trying to learn to do everything through bash. First I use "gzip -d snns.tar.gz". I don't know how to use the tar command (I try "tar -x snns.tar" but that does not work) so I use the gui to extract the files. Then I run the script file configure (I don't know exactly what this does but I think it creakes a Makefile) that is included with the software. Then finally I use the 'make' command which I am assuming compiles the source code and installs everything. But after that I can't figure out how to run the program or where the files are installed to.If anyone can give a brief overview of the process of installing a program I would appreciate it. I have the "Redhat Linux bible" and have been going over the "Linux System Administrators guide" and am really confused by now.

Hi there!
I don't really know what you mean with "current directory" but I assume that you mean your home director, anyway this should work för any directory.
In your home directory there is a file called .bashrc (notice the dot infront). You could type in your home directory in the shell:
$ pico .bashrc
In that file add lines that might look like this:
PATH="$PATH:::$HOME/bin:"
exort PATHWhere and is an absolute path (e.g. /usr/local/bin). Notice the : at the end of each path. Restart your shell and type:
$ echo $PATH
to check if the new paths have been added.
The easiest way to install a so called source tar-ball (tar.gz-files) is by these steps:
$ tar -xzvf packagename.tar.gz
$ cd packagename/
$ ./configure
$ make
$ make installthe last step (make install) is the step you've missed. And for this command you need to be root (use su command to change user to root).
About where to install your programs... well this is based on who you ask, I myself installs new programs in /usr/local and if I'm upgrading, I install in that directory (upgrading packages that were installed durin systeminstallation could be tricky depending on what package is being upgraded)

The forum did not take < - chars...
Correction:
*************
In that file add lines that might look like this:PATH="$PATH:"any path":"another path":$HOME/bin:"
exort PATHWhere "any path" and "another path" is an absolute path (e.g. /usr/local/bin).
*************Sorry about that.
//Jonas

If you want to excute something in the current directory type:
./programname
The . means the current directory, like .. means the parent directory. If you really wanted to be able to type:
programname
instead, you could add . to your PATH variable:
export PATH=$PATH:.And the command to open a .tar.gz file is:
tar vxzf filename.tar.gz

![]() |
files
|
OpenPGP / GnuPG
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |