From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike McCarty Subject: Re: Running dosemu as a user Date: Thu, 29 Dec 2005 19:45:50 -0600 Message-ID: <43B4914E.4080300@sbcglobal.net> References: <43B423CB.5000400@sbcglobal.net> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-msdos-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: linux-msdos@vger.kernel.org Victor Warner wrote: > Thank you for your reply but this is the first time I have had to do this type > of thing.. I had already managed to figure that out :-) > There is only only .profile (in /root) but several .bashrc (/root, /home/victor, > /etc/bash, etc). > > In which one of the files do I add "export PATH=$PATH:/usr/local/bin"? For whichever user it is that is having the problem. > Any further help would be very gratefully received. I presume that you log in as user "victor". In that case, you put the export line in /home/victor/.bashrc If you also log in as "vwarner", then you would also put it into /home/vwarner/.bashrc This is only a convention, and you could put it elsewhere. Here is how this works: When you enter a command like $ ls your shell (bash in this case) first looks to see if it "knows" this command itself. In this case (ls) it does not. It then looks for an environment variable (just some information you have given to bash and given a name) for a list of directories to search for a file named "ls". The name of the environment variable is "PATH". The entries in the PATH variable are separated by the colon character (":"). To query what variables you have told bash about, you use the "set" command, which bash knows directly. Like this: $ set You'll see a bunch of stuff come out. Probably more than you want. So you can use "less" to view it. Like this: $ set | less Or if you want to query your PATH, you can use grep, like this: $ set | grep PATH Mine looks like this... $ set | grep PATH PATH=/home/jmccarty/bin:/home/jmccarty/games/usr/games:/home/jmccarty/devtools/assemblers/asxxxx/asxv4pxx/asxmak/linux/exe:/usr/local/lib/lcc:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin So, when I type in "ls fred", bash first sees that it doesn't know about "ls" directly, and it then looks for /home/jmccarty/bin/ls. It finds nothing. Then it looks for /home/jmccarty/games/usr/games/ls, and still finds nothing. Then it looks in /home/jmccarty/de... Eventually it looks for /bin/ls, and it finds an executable, which it loads and runs. To set a variable to a value, use $ set VARIABLE="value to set" This sets it only for the shell. To make the variable visible to other programs the shell runs, you need to export it. $ export VARIABLE These two commands may be abbreviated into just the export, like this $ export VARIBLE="value to set VARIABLE to" Now, to use what is in a variable when setting a variable, use the "$" symbol. Like this: $ set VAR1="string 1" $ set VAR2="$VAR1:string 2" This sets VAR2 to "string 1:string 2". So, $ export PATH="$PATH:/usr/local/bin" sets PATH to whatever it already is, followed by a colon and some more information. It happens that there is a convention that applications use an "rc" file to Read Configuration from. For bash, it is ~/.bashrc, which contains a bunch of commands which bash executes upon startup. Got it? I suggest you use $ man bash $ info bash to get more information. Mike -- p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);} This message made from 100% recycled bits. You have found the bank of Larn. I can explain it for you, but I can't understand it for you. I speak only for myself, and I am unanimous in that!