Mail Archives: cygwin/2010/02/12/04:52:01
I created the ~/.profile in respons to the email fromCsaba Raduly. the bash man page does say it will look for ~/.profile as well.
The setup program creates some terminal links like:
C:\cygwin\bin\run.exe /usr/bin/rxvt.exe -display 127.0.0.1:0 -tn rxvt-cygwin -e /bin/bash --login
I just removed the --login option to preserve the results of ~/.bashrc, but then need to set up things like my prompt again as I loose the other automatic settings.
This was a new cygwin install, downloaded a couple of days ago.
I was trying to copy the skel/.bash_profile and got this:
$ cp /etc/skel/.bash_profile ~/
cp: not writing through dangling symlink `/home/blueneil/.bash_profile'
but
cat /etc/skel/.bash_profile > ~/.bash_profile
all works as expected and calls ~/.bashrc
Neil
----- Original Message ----
From: John Morrison <john AT morrison DOT mine DOT nu>
To: cygwin AT cygwin DOT com
Sent: Fri, February 12, 2010 9:34:15 AM
Subject: Re: .bashrc file not run
On Fri, February 12, 2010 9:17 am, Neil Blue wrote:
> The ~/.bashrc file wasn't called by default and altering ~/.profile did
> fix the problem.
Hi Neil,
Where did you get the ~/.profile from? It's not a base-file file...
> The comments in /etc/profile seem to imply that ~/.bashrc should be run
> on a per user basis automatically, but this was not the case.
<snip>/etc/profile quote</snip>
> /etc/skel/.bash_profile does have the code to call ~/.bashrc, but it
> doesn't seem to get used.
<snip>~/.bash_profile quote</snip>
> I still need to start bash without --login however as any settings such
> as PATH that are configured in ~/.bashrc are lost, but it does run the
> ~/.bashrc file.
Strange, I just run;
C:\cygwin\bin\mintty.exe
/etc/profile
~/.bash_profile
~/.bashrc
are called, but I don't have a ~/.profile. I wonder if bash is using
~/.profile in preference to ~/.bash_profile.
Do you have ~/.bash_profile? If not could you copy it from your /etc/skel
directory, rename your ~/.profile out of the way and try again?
This has been running out of the box like this for a number of years - I'd
be interested in knowing where the sequence has been changed and why...
Thanks,
J.
> Neil
>
>
> ----- Original Message ----
> From: John Morrison <john AT morrison DOT mine DOT nu>
> To: cygwin AT cygwin DOT com
> Sent: Fri, February 12, 2010 8:26:24 AM
> Subject: Re: .bashrc file not run
>
> ~/.bash_profile should already be setup to call ~/.bashrc
>
> it should have been in the base-files package which creates the /etc/skel
> files which should be copied when the user first log's on.
>
> AFAIK bash doesn't use a ~/.profile file. I *think* it's the KORN shell
> that does... do you mean /etc/profile?
>
> J.
>
> On Thu, February 11, 2010 4:28 pm, Neil Blue wrote:
>> Great,
>>
>> Thank you both. I now have .bash_profile calling ~/.bashrc.
>>
>> Just had a look at the ~/.profile script on my linux box and I can see
>> where it is making the call to the local ~/.bashrc file
>>
>> ...
>> # if running bash
>> if [ -n "$BASH_VERSION" ]; then
>> # include .bashrc if it exists
>> if [ -f "$HOME/.bashrc" ]; then
>> . "$HOME/.bashrc"
>> fi
>> fi
>> ...
>>
>> I guess I am too used to having this already set-up for me.
>>
>> Thanks again for the help.
>>
>> Cheers
>> Neil
>>
>>
>>
>> ----- Original Message ----
>> From: Csaba Raduly <rcsaba AT gmail DOT com>
>> To: cygwin AT cygwin DOT com
>> Sent: Thu, February 11, 2010 3:30:15 PM
>> Subject: Re: .bashrc file not run
>>
>> On Thu, Feb 11, 2010 at 4:06 PM, Thomas Wolff wrote:
>>> On 11.02.2010 15:55, Neil Blue wrote:
>>>
>>> By design (and documentation), bash runs *only* .profile (and
>>> /etc/profile)
>>> if started as a "login shell".
>>
>> Not quite.
>> From "info bash" , Node: Bash Startup Files
>>
>> When Bash is invoked as an interactive login shell, or as a
>> non-interactive shell with the `--login' option, it first reads and
>> executes commands from the file `/etc/profile', if that file exists.
>> After reading that file, it looks for `~/.bash_profile',
>> `~/.bash_login', and `~/.profile', in that order, and reads and
>> executes commands from the first one that exists and is readable.
>>
>>
>> Note to Neil: .bashrc_profile is ignored by bash. You want .bash_profile
>>
>> Hope this helps.
>> --
>> Life is complex, with real and imaginary parts
>>
>> --
>> Problem reports: http://cygwin.com/problems.html
>> FAQ: http://cygwin.com/faq/
>> Documentation: http://cygwin.com/docs.html
>> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>>
>>
>>
>>
>> --
>> Problem reports: http://cygwin.com/problems.html
>> FAQ: http://cygwin.com/faq/
>> Documentation: http://cygwin.com/docs.html
>> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>>
>>
>>
>
>
>
> --
> Problem reports: http://cygwin.com/problems.html
> FAQ: http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>
>
>
>
>
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -