From mboxrd@z Thu Jan 1 00:00:00 1970 From: Victor Warner Subject: Re: Running dosemu as a user Date: Tue, 03 Jan 2006 17:05:23 +0000 Message-ID: Mime-Version: 1.0 Content-Transfer-Encoding: binary Return-path: Content-Disposition: inline Sender: linux-msdos-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" To: linux-msdos@vger.kernel.org Peter, Thank you for the information. Your very helpful explanation pre-empted a question: that if I just add a PATH variable for /usr/local/bin whether I would overwrite any PATH variables. It seems clear that this will not happen. Also thank for providing: "~/.bash_profile (not .bashrc) file: if ! echo "$PATH" | grep "/usr/local/bin"; then PATH="$PATH:/usr/local/bin" fi export PATH" What you and Mike have written has put a lot of information in context. I have never heard of Rube Goldberg. But looking at his web site I can see the resemblance... Victor Warner On Tue, 03 Jan 2006 09:03 , Peter B. Steiger sent: >On Tue, 2006-01-03 at 14:42 +0000, Victor Warner wrote: >> However, Linspire does not store the PATH for a user in .profile or .bashrc >> files (where ever they are located). > >Victor, >Linspire can't put PATH anywhere that other Linux distros put it; under >all the fancy decorations it's still running the startup (SysV init) and >console shell (probably bash) as any other Linux. > >Adding to what Mike said, the dotted files (.profile and .bashrc) are >only used for changes each user might want to make personally to what >the system sets up for all users. For example, the system might decree >that only /bin and /usr/bin are in the path, but you might want to >add /usr/local/bin to that path. Fred might want his path to include >his personal directory (/home/fred/bin), and so on. When Mike talks >about ~/.profile, the tilde is a shortcut that means "the /home >directory for the login you are currently using". If you are root, ~ >is /root. If you are rumplestiltskin, ~ is /home/rumplestiltskin. So >each ~/.profile is different for each login. > >Now, when you first log in, three environment setting scripts are run in >this order: /etc/security/pam_env.conf (if they use pluggable >authentication modules for security, which they probably do), >then /etc/profile, then ~/.bash_profile. The first two are run for >every user as soon as you log in, so even if you don't have >a .bash_profile or .profile or .bashrc in your home directory, you will >have the same basic path set that everyone has. > >So, if the default path does not include a path to the dosemu binary, >add this to your ~/.bash_profile (not .bashrc) file: > > if ! echo "$PATH" | grep "/usr/local/bin"; then > PATH="$PATH:/usr/local/bin" > fi > export PATH > >The "if" line ensures that if /usr/local/bin is already part of the >path, it won't get re-added every time the shell invokes another child >copy - with the result that your path would include /usr/local/bin >numerous times. > >Clear as mud? {grin} I spent several hours one day tracing through the >login and shell startup processes to see which scripts get invoked when, >and I finally have a pretty good idea of how it all works. A flowchart >would resemble a Rube Goldberg illustration! > >Regarding Mike's instructions on how to examine the current PATH value >from a console shell: I've been using DOS in some form for 25 years, so >I added aliases to mimic DOS commands: >alias path='echo $PATH' >alias ver='cat /proc/ver' >alias del='rm' >alias dir='ls' > >I also renamed my /etc/rc.d/init.d/functions file to config.sys, >and /etc/rc.d/rc.sysinit to autoexec.bat, but that's just because I have >a sick sense of humor. > >-- >Peter B. Steiger >Cheyenne, WY > > ---- Message sent via Waitrose Webmail - http://www.waitrose.com/