Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 19/01/2009, à 09:38

Grand Hibou

[Résolu]erreur bash suite à modification .bashrc

Hello,

j'ai voulu faire une petite modification pour faire afficher un message au lancement de mes shells sur ma kubuntu hardy. J'ai copié collé quelques lignes trouvées sur le net dans mon .bashrc. mais comme cela faisait une errreur j'ai enlevé ces lignes.
Malheureusement j'ai toujours une erreur au lancement des shells maintenant sur une ligne, la 58:

-bash: /home/nobody/.bashrc: line 58: Erreur de syntaxe près du symbole inattendu « newline »
-bash: /home/nobody/.bashrc: line 58: `*'



1 # ~/.bashrc: executed by bash(1) for non-login shells.
  2 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  3 # for examples
  4
  5 # If not running interactively, don't do anything
  6 [ -z "$PS1" ] && return
  7
  8 # don't put duplicate lines in the history. See bash(1) for more options
  9 export HISTCONTROL=ignoredups
 10 # ... and ignore same sucessive entries.
 11 export HISTCONTROL=ignoreboth
 12
 13 # check the window size after each command and, if necessary,
 14 # update the values of LINES and COLUMNS.
 15 shopt -s checkwinsize
 16
 17 # make less more friendly for non-text input files, see lesspipe(1)
 18 [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
 19
 20 # set variable identifying the chroot you work in (used in the prompt below)
 21 if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
 22     debian_chroot=$(cat /etc/debian_chroot)
 23 fi
 24
 25 # set a fancy prompt (non-color, unless we know we "want" color)
 26 case "$TERM" in
 27     xterm-color) color_prompt=yes;;
 28 esac
 29
 30 # uncomment for a colored prompt, if the terminal has the capability; turned
 31 # off by default to not distract the user: the focus in a terminal window
 32 # should be on the output of commands, not on the prompt
 33 #force_colored_prompt=yes
 34
 35 if [ -n "$force_color_prompt" ]; then
 36     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
 37         # We have color support; assume it's compliant with Ecma-48
 38         # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
 39         # a case would tend to support setf rather than setaf.)
 40         color_prompt=yes
 41     else
 42         color_prompt=
 43     fi
 44 fi
 45
 46 if [ "$color_prompt" = yes ]; then
 47     PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
 48 else
 49     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
 50 fi
 51 unset color_prompt force_color_prompt
 52
 53 # If this is an xterm set the title to user@host:dir
 54 case "$TERM" in
 55 xterm*|rxvt*)
 56     PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
 57     ;;
 58 *
 59     ;;
 60 esac
 61
 62 # Alias definitions.
 63 # You may want to put all your additions into a separate file like
 64 # ~/.bash_aliases, instead of adding them here directly.
 65 # See /usr/share/doc/bash-doc/examples in the bash-doc package.
 66
 67 #if [ -f ~/.bash_aliases ]; then
68 #    . ~/.bash_aliases
 69 #fi
 70
 71 # enable color support of ls and also add handy aliases
 72 if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then
 73     eval "`dircolors -b`"
 74     alias ls='ls --color=auto'
 75     #alias dir='ls --color=auto --format=vertical'
 76     #alias vdir='ls --color=auto --format=long'
 77
 78     #alias grep='grep --color=auto'
 79     #alias fgrep='fgrep --color=auto'
 80     #alias egrep='egrep --color=auto'
 81      alias grep='grep --color=always'
 82
 83 fi
 84
 85 # some more ls aliases
 86 #alias ll='ls -l'
 87 #alias la='ls -A'
 88 #alias l='ls -CF'
 89
 90 # enable programmable completion features (you don't need to enable
 91 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
 92 # sources /etc/bash.bashrc).
 93 if [ -f /etc/bash_completion ]; then
 94     . /etc/bash_completion
 95 fi
 96
 97

Dernière modification par Grand Hibou (Le 19/01/2009, à 10:40)


"Certains disent qu'en faisant marcher le cd de windows vista à l'envers on entendrait des voix vous commandant d'adorer Satan. Mais c'est rien ça. Quand vous le faites marcher à l'endroit, il vous installe windows vista!"

Hors ligne

#2 Le 19/01/2009, à 10:23

Tycho Brahe

Re : [Résolu]erreur bash suite à modification .bashrc

Salut,

Il te manque une parenthèse fermante à la ligne 57. Je te colle ici les lignes 53 a 60 corrigées :

# If this is an xterm set the title to user@host:dir                            
case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    ;;
*)
    ;;
esac

Loi de Newton :
Si tu restes à glander sous le pommier, tu pourrais bien prendre une pomme sur la gueule.

Hors ligne

#3 Le 19/01/2009, à 10:39

Grand Hibou

Re : [Résolu]erreur bash suite à modification .bashrc

cool man! cool


"Certains disent qu'en faisant marcher le cd de windows vista à l'envers on entendrait des voix vous commandant d'adorer Satan. Mais c'est rien ça. Quand vous le faites marcher à l'endroit, il vous installe windows vista!"

Hors ligne