Bonjour,
j'ai un petit problème pour configurer bash.
quand je modifie mon fichier bashrc (dans le répertoire $HOME)en rajoutant des alias, en tant que simple utilisateur cela ne marche pas.
en revanche si je modifie le bashrc (etc/bashrc), les alias sont prit en compte, mais seulement quand j'ouvre une console en mode super utilisateur...
comment arranger le probleme?
je vais faire des copié coller de tous les fichiers important :
Mon login est loicus...
merci d'avance pour votre aide...
pcq je ne vois vraiment pas pourquoi ca ne marche pas.
loic,
####################
/root/.bashrc
####################
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
#test
alias loicus='animate'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
ls
####################
/root/.bash_profile
####################
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
####################
/root/.bash_logout
####################
# ~/.bash_logout
clear
####################
/home/loicus/.bashrc
####################
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias loicus='animate'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
####################
/home/loicus/.bash_profile
####################
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
####################
/home/loicus/.bash_logout
####################
# ~/.bash_logout
clear
####################
/etc/bashrc
####################
# /etc/bashrc
# System wide functions and aliases
# Environment stuff goes in /etc/profile
# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
umask 002
else
umask 022
fi
# are we an interactive shell?
if [ "$PS1" ]; then
case $TERM in
xterm*)
if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
else
PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}07"'
fi
;;
screen)
if [ -e /etc/sysconfig/bash-prompt-screen ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
else
PROMPT_COMMAND='echo -ne "33_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}33"'
fi
;;
*)
[ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
;;
esac
# Turn on checkwinsize
shopt -s checkwinsize
[ "$PS1" = "s-v$ " ] && PS1="[u@h W]$ "
fi
if ! shopt -q login_shell ; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
fi
echo 'etc/bashrc/ -> loaded'
$HOME/.bash_profile
# vim:ts=4:sw=4
####################
/etc/profile
####################
# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|🙂$1($|🙂" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}
# Path manipulation
if [ `id -u` = 0 ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
pathmunge /usr/X11R6/bin after
# No core files by default
ulimit -S -c 0 > /dev/null 2>&1
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HOSTNAME=`/bin/hostname`
HISTSIZE=1000
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
unset pathmunge
####################
/etc/profile.d
####################
list des fichiers :
[localhost] /etc/profile.d > ls
colorls.csh glib2.csh gnome-afs-profile.csh gnome-ssh-askpass.csh kde.csh krb5.csh lang.csh less.csh mc.csh qt.csh vim.csh which-2.sh zz_sue.sh zzz_hepix.sh
colorls.sh glib2.sh gnome-afs-profile.sh gnome-ssh-askpass.sh kde.sh krb5.sh lang.sh less.sh mc.sh qt.sh vim.sh zz_sue.csh zzz_hepix.csh
j'ai un petit problème pour configurer bash.
quand je modifie mon fichier bashrc (dans le répertoire $HOME)en rajoutant des alias, en tant que simple utilisateur cela ne marche pas.
en revanche si je modifie le bashrc (etc/bashrc), les alias sont prit en compte, mais seulement quand j'ouvre une console en mode super utilisateur...
comment arranger le probleme?
je vais faire des copié coller de tous les fichiers important :
Mon login est loicus...
merci d'avance pour votre aide...
pcq je ne vois vraiment pas pourquoi ca ne marche pas.
loic,
####################
/root/.bashrc
####################
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
#test
alias loicus='animate'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
ls
####################
/root/.bash_profile
####################
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
####################
/root/.bash_logout
####################
# ~/.bash_logout
clear
####################
/home/loicus/.bashrc
####################
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias loicus='animate'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
####################
/home/loicus/.bash_profile
####################
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
####################
/home/loicus/.bash_logout
####################
# ~/.bash_logout
clear
####################
/etc/bashrc
####################
# /etc/bashrc
# System wide functions and aliases
# Environment stuff goes in /etc/profile
# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
umask 002
else
umask 022
fi
# are we an interactive shell?
if [ "$PS1" ]; then
case $TERM in
xterm*)
if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
else
PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}07"'
fi
;;
screen)
if [ -e /etc/sysconfig/bash-prompt-screen ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
else
PROMPT_COMMAND='echo -ne "33_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}33"'
fi
;;
*)
[ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
;;
esac
# Turn on checkwinsize
shopt -s checkwinsize
[ "$PS1" = "s-v$ " ] && PS1="[u@h W]$ "
fi
if ! shopt -q login_shell ; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
fi
echo 'etc/bashrc/ -> loaded'
$HOME/.bash_profile
# vim:ts=4:sw=4
####################
/etc/profile
####################
# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|🙂$1($|🙂" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}
# Path manipulation
if [ `id -u` = 0 ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
pathmunge /usr/X11R6/bin after
# No core files by default
ulimit -S -c 0 > /dev/null 2>&1
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HOSTNAME=`/bin/hostname`
HISTSIZE=1000
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
unset pathmunge
####################
/etc/profile.d
####################
list des fichiers :
[localhost] /etc/profile.d > ls
colorls.csh glib2.csh gnome-afs-profile.csh gnome-ssh-askpass.csh kde.csh krb5.csh lang.csh less.csh mc.csh qt.csh vim.csh which-2.sh zz_sue.sh zzz_hepix.sh
colorls.sh glib2.sh gnome-afs-profile.sh gnome-ssh-askpass.sh kde.sh krb5.sh lang.sh less.sh mc.sh qt.sh vim.sh zz_sue.csh zzz_hepix.csh