[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: .bash_profile



On 2003-07-02 18:34:14 +0200, Roha wrote:

> Problemet är att vissa saker som jag gjorde i .bash_profile bara
> behöver/ska göras vid inloggning. tex montering av hd-partitioner
> och .bash_profile körs tydligen inte när jag loggar in via kdm. Så
> frågan är: Finns det någon/några filer som alltid och enbart körs
> vid inloggning.

Jag har snickrat ihop följande sammanfattning åt mig själv (baserad på
diverse dokumentation) för att inte bli tokig när jag ska ändra något.
Helt säkert är den inte felfri.

Om jag har förstått saken rätt så är det ett "interactive login shell"
då man loggar in vid text-loginprompten, ett vanligt "interactive
shell" då man t.ex. startar en xterm eller överhuvud taget då man kör
bash-binären direkt. "Noninteractive" är det då man kör ett
bashscript.

Jag vet inte vad av detta som gäller när du loggar in med kdm; såvitt
jag kan se kör kdm sh-scriptet /etc/X11/Xsession, som slutar med att
exec:a kde3 eller nån annan fönsterhanterare, eller din ~/.xsession om
du har slagit på sånt. Nån som kan det här bättre får gärna glida in
nu och förklara resten. :-)


Interactive login shell
----------------------------------------------------------------------
/etc/profile
	Sourced first for any login shell.

~/.bash_profile OR ~/.bash_login OR ~/.profile
	bash looks for these files in the order listed and sources the
	first of them that exists and is readable. This file should
	contain things you want done only for login shells.

	It is probably a good idea to source ~/.bashrc somewhere in
	this file, if there are things you want done for any
	interactive shell, login or not.


		*************************
		**** SHELL RUNS HERE ****
		*************************


~/.bash_logout
	Sourced when the login shell exits.


Interactive shell that isn't a login shell
----------------------------------------------------------------------
~/.bashrc
	Put everything here that you want done for any interactive
	shell, login or not.


Noninteractive shell
----------------------------------------------------------------------
$BASH_ENV
	Sources the file named by the environment variable BASH_ENV,
	if that variable is set.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

Attachment: pgplQoIDKn8xQ.pgp
Description: PGP signature


Reply to: