RedHat 5.2 .bashrc wordt niet uitgevoerd

Pagina: 1
Acties:
  • 213 views

  • jonaskellens
  • Registratie: November 2006
  • Laatst online: 30-05-2011
OS : RedHat Enterprise Linux Advanced Platform 5.2
Shell : bash

Ik heb via useradd een gebruiker sybase gecreëerd.
sybase:x:500:500::/home/sybase:/bin/bash

Nu wil ik de omgeving voor deze gebruiker definiëren a.d.h.v. enkele variabelen.
Daarvoor heb ik handmatig een .bashrc-file aangemaakt (want dit is niet automatisch gecreëerd via useradd) in /home/sybase :

-rwxr--r-- 1 sybase sybase .bashrc

Nu merk ik dat wanneer ik inlog als sybase-user ( su - sybase ) dit .bashrc-file niet geladen wordt.

Wanneer ik 'env' geef als opdracht in de console, staat de variabele $SYBASE er niet tussen.

.bashrc (inhoud) :

export SYBASE=/opt/sybase
source $SYBASE/SYBASE.sh

Weet iemand waarom .bashrc niet geladen wordt ??

Verwijderd

bash zoekt allereerst naar .profile of .bash_profile (een van die twee). .bashrc is niet een standaard bestand van bash geloof ik, maar wordt door veel distro's wel gebruikt.

  • jonaskellens
  • Registratie: November 2006
  • Laatst online: 30-05-2011
OK, heel onnozel maar .bash_profile wordt wel uitgevoerd bij het inloggen...
De environment is correct geset...

Dank voor de reply !

  • igmar
  • Registratie: April 2000
  • Laatst online: 05-01 19:56

igmar

ISO20022

jonaskellens schreef op donderdag 07 augustus 2008 @ 13:59:
Weet iemand waarom .bashrc niet geladen wordt ??
Omdat ie dat nooit doet bij een login shell :
When bash is invoked as an interactive login shell, or as a non-inter-
active shell with the --login option, it first reads and executes com-
mands 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. The --noprofile option may be used when the
shell is started to inhibit this behavior.

When a login shell exits, bash reads and executes commands from the
file ~/.bash_logout, if it exists.

When an interactive shell that is not a login shell is started, bash
reads and executes commands from ~/.bashrc, if that file exists. This
may be inhibited by using the --norc option. The --rcfile file option
will force bash to read and execute commands from file instead of
~/.bashrc.

  • blaataaps
  • Registratie: Juli 2001
  • Niet online
Dit is inderdaad gewoon gedocumenteerd gedrag van bash, naast t feit dat ik niemand redhat 5.2 zou durven aanraden :)

Dit topic is gesloten.