• [^] # Re: Test de login interactif

    Posté par . En réponse au message Bashrc avec paramètre ?. Évalué à 2. Dernière modification le 13 avril 2015 à 14:37.

    Certes mais a priori, dans son cas précis, il semble lu.

    Sur une ubuntu 14.10 par défaut, et comme l'évoque le commentaire ci dessus, le .bashrc est appelé par le .profile (qui replace le .bash_profile ici)

    plop@plop $ more .profile
    # ~/.profile: executed by the command interpreter for login shells.
    # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
    # exists.
    # see /usr/share/doc/bash/examples/startup-files for examples.
    # the files are located in the bash-doc package.
    # the default umask is set in /etc/profile; for setting the umask
    # for ssh logins, install and configure the libpam-umask package.
    #umask 022
    # if running bash
    if [ -n "$BASH_VERSION" ]; then
     # include .bashrc if it exists
     if [ -f "$HOME/.bashrc" ]; then
     . "$HOME/.bashrc"
     fi
    fi
    # set PATH so it includes user's private bin if it exists
    if [ -d "$HOME/bin" ] ; then
     PATH="$HOME/bin:$PATH"
    fi
    plop@plop $ man .bash
    [...]
    FILES
     /bin/bash
     The bash executable
     /etc/profile
     The systemwide initialization file, executed for login shells
     /etc/bash.bashrc
     The systemwide per-interactive-shell startup file
     /etc/bash.bash.logout
     The systemwide login shell cleanup file, executed when a login shell exits
     ~/.bash_profile
     The personal initialization file, executed for login shells
     ~/.bashrc
     The individual per-interactive-shell startup file
     ~/.bash_logout
     The individual login shell cleanup file, executed when a login shell exits
     ~/.inputrc
     Individual readline initialization file
    [...]

    D'après le manuel, le fichier profile est exécuté pour les "login shell" : scp est-il un "login shell" ?