Problem with Bash regex test case sensitivity

David Sastre
Sat Dec 4 15:12:00 GMT 2010

On Sat, Dec 04, 2010 at 10:05:42AM -0400, Lee wrote:
> > On 12/03/2010 07:11 PM, Lee wrote:
> why put the local
> defaults in ~/.bashrc?  My understanding is that ~/.bashrc is called
> at every shell startup.  Seems like that's one of those things that
> just needs to be set in the login shell, so wouldn't ~/.bash_profile
> be more appropriate for the locale settings?

(Most probably you already know all of this, but...)
As of now, the default settings are provided via /etc/profile:

if [ -d "/etc/profile.d" ]; then
  while read f; do
    if [ -f "${f}" ]; then
      . "${f}"
  done <<- EOF
  `/bin/find -L /etc/profile.d -type f -iname '*.sh' -or -iname '*.zsh' | LC_ALL=C sort`

which in turn sources /etc/profile.d/

# if no locale variable is set, indicate terminal charset via LANG
test -z "${LC_ALL:-${LC_CTYPE:-$LANG}}" && export LANG=C.UTF-8

The bash manual page explains the order in which startup files are
read for both login and non-login shells (both interactive and
non-interactive). So, given that ~/.bash_profile sources ~/.bashrc, (in
our cygwin defaults), that looks like an easy way to set your LANG in a 
per-user manner, no matter what kind of shell you open.
If you want it to be a system-wide setting, you should use
/etc/bash.bashrc (for the bash shell, of course).
Setting it only in ~/.bash_profile makes it invisible for non-login

Huella de clave primaria: 0FDA C36F F110 54F4 D42B  D0EB 617D 396C 448B 31EB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <>

More information about the Cygwin mailing list