This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: More newbie questions to get up to speed....


adrian wrote:

>Thanks to those who helped me a few weeks suggesting how to set up bash
>to read my .bashrc and to start in my home directory.

>I added in the cygnus.bat file the lines:
>1> SET USER=%USERNAME%
>2> SET HOME=/home/%USERNAME%
>3>.....
>4> bash -login

>My .bash_profile and .bashrc are executed.  But I still end up in the
>desktop directory. If I type "> cd", I do end up in my home directory.
>Does bash not perform the same here as on a UNIX platform? I always end
>up in the home directory there.  I suppose a simple "> cd" at the end of
>my .bash_profile will solve.  I want to make sure there isn't something
>funny going on somewhere else.

on unix, the login program sets your current directory to that in
/etc/passwd before invoking your shell so you start in $HOME.

on (local) cygwin, you run bash, either from explorer, cmd or command.
the current directory will be whatever the invoking process makes it
so you may well start in the desktop.

"cd" at the top of your .bash_profile should work.
or have an icon with the working directory property set to your home.

>BASH PROMT:
>I have set the PS1 prompt to:
>PS1="\u on \h <\!> "

>The \u does not work for me.  I end up with:
>I have no name! on XXX <1> 

>What variable does \u use?  I have %USER% and %USERNAME% both defined!
>If I "> echo $USER" I get the correct username.

neither. have you set up /etc/passwd yet?
bash gets \u from there (at least in the src here at work).


raf

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]