Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

ordre dans le shell

3 réponses
Avatar
David Remacle
Salut,

J'aimerai savoir quel est, sur Mac OS X, l'ordre des fichiers pris en
compte au démarage d'un Shell avec terminal.app.

Est-ce :

1) .bashrc
2) .profile

ou l'inverse :

1) .profile
2) .bashrc


Merci d'éclaircir ma lanterne.

--
http://www.clampin.com/
CC BY-NC-ND

3 réponses

Avatar
patpro ~ Patrick Proniewski
In article <4ddbc116$0$679$,
David Remacle wrote:

Salut,

J'aimerai savoir quel est, sur Mac OS X, l'ordre des fichiers pris en
compte au démarage d'un Shell avec terminal.app.

Est-ce :

1) .bashrc
2) .profile

ou l'inverse :

1) .profile
2) .bashrc


Merci d'éclaircir ma lanterne.



C'est tout détaillé dans man bash

patpro

--
A vendre ! http://www.patpro.net/blog/index.php/2008/01/12/133
Avatar
Matt
On Mar 24 mai 2011, 16:30,
David Remacle wrote:

Salut,



Hello,

J'aimerai savoir quel est, sur Mac OS X, l'ordre des fichiers pris en
compte au démarage d'un Shell avec terminal.app.



Oh un nouveau « Thomas » :)
Pour zsh c'est assez simple :

$ man 1 zsh
/STARTUP/SHUTDOWN FILES

Pour bash, ben cf. la réponse de Patpro.

Merci d'éclaircir ma lanterne.



Je t'en prie.

--
echo '' |
tr '[a-z]' '[n-za-m]'
Avatar
blanc
David Remacle wrote:

J'aimerai savoir quel est, sur Mac OS X, l'ordre des fichiers pris en
compte au démarage d'un Shell avec terminal.app.



Ça n'est pas spécifique à Mac OS X. L'ordre est spécifié par les
concepteurs de bash et devrait être le même sous tout Unix/linux...


Est-ce :

1) .bashrc
2) .profile

ou l'inverse :

1) .profile
2) .bashrc


Merci d'éclaircir ma lanterne.



man bash :
The following paragraphs describe how bash executes its startup files. If
any of the files exist but cannot be read, bash reports an error. Tildes
are expanded in file names as described below under Tilde Expansion in the
EXPANSION section.

When bash is invoked as an interactive login shell, or as a
non-interac- tive 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.
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.

When bash is started non-interactively, to run a shell script,
for exam- ple, it looks for the variable BASH_ENV in the environment,
expands its value if it appears there, and uses the expanded value as
the name of a file to read and execute. Bash behaves as if the following
command were executed: if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi but
the value of the PATH variable is not used to search for the file
name. If bash is invoked with the name sh, it tries to mimic the startup
behav- ior of historical versions of sh as closely as possible, while
conforming to the POSIX standard as well. When invoked as an
interactive login shell, or a non-interactive shell with the
--login option, it first [... snip]



--
JiPaul.
/ /--/--// Jean-Paul Blanc
|/| L | quelquepart en (somewhere in)
/|| = ||| FRANCE