bash fichier de conf

Pierre Bouvier

Membre actif
31 Mars 2001
559
0
Bonjour


Où se trouve dans panther le fichier de conf de bash qui me permettrait de mettre des alias de commande. Pour tcsh j'utilisais un fichier .tcshrc qui permettait ceci.

J'aimerais bien en effet utiliser bash qui permet enfin de faire un copier/coller avec le bouton du milieu de la souris.

 
thomzz a dit:
Etrangement le fichier .bashrc marche avec xterm dans X11 mais pas dans le Terminal. Par contre .profile marche avec le Terminal...

Il n'y a rien d'étrange. Lorsque bash est invoqué en mode interactif ET login - c'est le cas de terminal -, .profile est exécuté tandis qu'en mode interactif non login - cas xterm -, c'est .bashrc qui est exécuté.

Si tu veux systématiquement exécuter .bashrc, ajoutes une ligne "source .bashrc" dans ton .profile (ou mieux dans .bash_profile).
 
cygwin a dit:
Si tu veux systématiquement exécuter .bashrc, ajoutes une ligne "source .bashrc" dans ton .profile (ou mieux dans .bash_profile).
On peut aussi procéder de la sorte :
Bloc de code:
ln -s ~/.bashrc ~/.bash_login
Tu auras alors le même fichier dans les deux cas. La solution de cygwin est tout aussi valable, c'est une question de goût.
wink.gif


À+
 

Merci de vos réponses


maintenant une autre question. Il existe pas mal de différences de syntaxe entre tcsh et bash, alors comment changer le prrompt de bash. Dans le .tcshrc j'utilisais une commande du style : set prompt = '[%m : %c03] %n > '. Bien evidemment elle ne fonctionne pas avec bsh. Une Idée ?
 
Je ne connais pas bien tcsh (et donc les signification de %m, %c, etc).

Disons qu'en bash, on fait

PS1='ta chaîne de prompt'
export PS1

Par exemple,

export PS1='[\H] \! > '

Si ça peut t'aider, voici une liste de 'prompt strings' (pas exhausive):

\a an ASCII bell character (07)
\d the date in "Weekday Month Date" format (e.g., "Tue May 26")
\e an ASCII escape character (033)
\h the hostname up to the first `.'
\H the hostname
\j the number of jobs currently managed by the shell
\l the basename of the shell's terminal device name
\n newline
\r carriage return
\s the name of the shell, the basename of $0 (the portion
following the final slash)
\t the current time in 24-hour HH:MM:SS format
\T the current time in 12-hour HH:MM:SS format
\@ the current time in 12-hour am/pm format
\A the current time in 24-hour HH:MM format
\u the username of the current user
\v the version of bash (e.g., 2.00)
\V the release of bash, version + patchelvel (e.g., 2.00.0)
\w the current working directory
\W the basename of the current working directory
\! the history number of this command
\# the command number of this command
\$ if the effective UID is 0, a #, otherwise a $
\nnn the character corresponding to the octal number nnn
\\ a backslash
 
he les gas soit vous changer votre shell

? pourquoi jongler avec dix shell ils ne sont pas imperméables


example .tcshrc

set path = ( $path /usr/port/bin /usr/port/sbin /usr/port/XFce4/bin /usr/port/XFce4/sbin)
setenv PATH /bin:/sbin:/usr/port/bin:/usr/port/sbin:/usr/bin:/usr/sbin:/usr/port/XFce4/bin:/usr/port/XFce4/sbin
setenv LD_LIBRARY_PATH /usr/lib:/usr/port/lib:/usr/port/XFce4/lib
setenv DYLD_LIBRARY_PATH ${LD_LIBRARY_PATH}
setenv MANPATH /usr/share/man:/usr/port/share/man
setenv INFOPATH /usr/share/info:/usr/port/share/info

unsetenv TERMCAP
setenv HOST porthost
setenv CLASSPATH /System/Library/Frameworks/JavaVM.framework/Home/lib
setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Home

#ici j'attaque le prompt

if ( $?prompt ) then
alias lsc '/usr/port/sbin/lscolor --color=auto'
alias mre 'more'
alias mdr 'mkdir'
alias clr 'clear'
alias safari 'open -a Safari'
alias iexplorer 'open -a Internet\ Explorer'
alias mozilla 'open -a Mozilla'
alias preview 'open -a Preview'
alias itunes 'open -a iTunes'
alias ichat 'open -a iChat'
alias iphoto 'open -a iPhoto'
alias emptytrash 'rm -R ~/.Trash/*'
endif

Cordialement le plumber de toyo