From: Mike McCarty <mike.mccarty@sbcglobal.net>
To: linux-msdos@vger.kernel.org
Subject: Re: Running dosemu as a user
Date: Thu, 29 Dec 2005 19:45:50 -0600 [thread overview]
Message-ID: <43B4914E.4080300@sbcglobal.net> (raw)
In-Reply-To: <loom.20051230T011518-184@post.gmane.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!
next prev parent reply other threads:[~2005-12-30 1:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-29 13:47 Running dosemu as a user Victor Warner
2005-12-29 17:58 ` Mike McCarty
2005-12-30 0:16 ` Victor Warner
2005-12-30 1:45 ` Mike McCarty [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-01-03 14:42 Victor Warner
2006-01-03 17:05 Victor Warner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43B4914E.4080300@sbcglobal.net \
--to=mike.mccarty@sbcglobal.net \
--cc=linux-msdos@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.