Operating System - Microsoft
cancel
Showing results for 
Search instead for 
Did you mean: 

cygwin bash --login

Christian Deutsch_1
Esteemed Contributor

cygwin bash --login

Hi folks,

I start my bash using this script:
--
@echo off

C:
chdir \home\homedir

set CYGWIN=tty
set HOME=/cygdrive/c/home/homedir
set ENV=/cygdrive/c/home/homedir/.bashrc

c:\bin\bash -i
--
This script correctly loads my .bashrc file.

Strangely (for me), if, while in bash, I start bash --login, this new bash does *not* load my .bashrc file, even though ENV is exported correctly in /cygdrive/c/home/homedir/.profile

Any idea why this is so?

All helpful answers will get points.

Thanks, Christian
Yeshua loves you!
6 REPLIES
Norman_21
Honored Contributor

Re: cygwin bash --login

Christian,

Will this help:
http://cygwin.com/faq.html

Aso, you didn't mention what Windows OS are you running Cygwin on?

Did you run env command to see if the environment is really exported?

echo $SHELL to double check the shell

Also, check the bashrc file permissions?

Finaly, I'd prefer to install and run SFU in Windows OS. SFU has different shell environment that you can use:
http://www.microsoft.com/windows/sfu/

Please keep me updated

Thanks


"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Christian Deutsch_1
Esteemed Contributor

Re: cygwin bash --login

Dear Latif,

Thankyou very much for responding! I was wondering if anyone was going to bother to respond...

1. The situation is not critical, but I would like to find out what is going on
2. SFU is not an option for me because my cygwin is working fine and bash is a great shell
3. I didn't look at the faq because I am experienced with shells and so on. This unexpected bash behaviour is strange for me.
4. Permissions are: read and execute for all and as I had mentioned, the .bashrc file is read if I start using bash -i or just bash but not when I use bash --login even though $HOME is exported and correct.
5. Sorry for only 3 points this time but your response was not truly helpful (maybe the next one will be)

Thanks, Christian
Yeshua loves you!
Norman_21
Honored Contributor

Re: cygwin bash --login

No worries about the points! I'll be glad if I could help you.
The reason why I posted the FAQ is because I found this maybe helpful:

Why doesn't bash read my .bashrc file on startup?
Your .bashrc is read from your home directory specified by the HOME environment variable. It uses /.bashrc if HOME is not set. So you need to set HOME correctly, or move your .bashrc to the top of the drive mounted as / in Cygwin.

Sorry if I couldn't be much of help since I'm not an expert in Cgywin. Perhaps, you'll get more luck in the HP-UX side:
http://forums1.itrc.hp.com/service/forums/familyhome.do?familyId=117

Good luck
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Christian Deutsch_1
Esteemed Contributor

Re: cygwin bash --login

Dear Latif,

Thanks for the quick response :-)

1. I tried changing HOME from /cygdrive/c/home/homedir to c:/home/homedir. It gave me a slightly different result but didn't read in my .bashrc file
2. I tried copying .bashrc to /. Still didn't get read in when starting bash --login
3. Maybe I could post the question to the ITRC Linux forum, since bash is in Linux too.

Thanks again, Christian
Yeshua loves you!
Norman_21
Honored Contributor

Re: cygwin bash --login

Christian,

The worst case will be to reinstall cygwin!

just my 0.02 Cents

"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Christian Deutsch_1
Esteemed Contributor

Re: cygwin bash --login

I wouldn't reinstall, I don't think installation is the problem, but thanks for replying anyway.

As already mentioned, maybe I'll post this question in the Linux forum, since it has more to do with bash than it has to do with cygwin.

Kind regards, Christian
Yeshua loves you!