Date: Tue, 19 Oct 1999 11:51:20 -0700 (PDT) From: patl@phoenix.volant.org To: Arcady Genkin <a.genkin@utoronto.ca> Cc: freebsd-questions@freebsd.org Subject: Re: Bash prompt (/usr/home/username instead of ~/) Message-ID: <ML-3.4.940359080.6212.patl@asimov> In-Reply-To: <87ln905oew.fsf@main.wgaf.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 18-Oct-99 at 13:38, Arcady Genkin (a.genkin@utoronto.ca) wrote: > patl@phoenix.volant.org writes: > > > > What happens if you put a 'cd' command right after the prompt is set? > > > > Shouldn't that be 'cd .' just in case you aren't in your home directory? > > IMHO, Quite on the contrary. "cd ." would mean change into the current > directory, as opposed to "cd", which means change into home directory > by default... Yes, exactly my point. > In any case, I don't know what the current directory is when starting > bash. [leaves to check] Yep, putting "cd ." results in bash opening up > current directory. As I recall, the goal was to get the initial path components to show up as '~' when appropriate in the prompt; and the 'problem' was that it didn't seem to take effect until after the first 'cd' after setting PS1. The suggestion was to put a 'cd' after the 'PS1=...' in the .bashrc. My point is that you might not be in your home directory when bash is started; and that changing the current directory is likely to be an undesired side-effect. Using 'cd .' should have no side-effects beyond triggering the change in the prompt. -Pat To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ML-3.4.940359080.6212.patl>