#1 Le 17/07/2010, à 08:21
- Shydow_BF
[bashrc] Unexpected end of file !
Bonjour à tous.
Tout d'abord, désolé si cette question a déja été posée, et je n'en doute pas, mais j'ai le problème suivant : j'ai voulu modifier mon ~/.bashrc, et j'ai l'erreur "unexpected end of file". Sur le Web, la plupart des erreurs similaires viennent d'un double ;, d'un if sans fi ou d'un case sans esac. Sauf que je n'ai mis aucun loop et aucune condition dans le bashrc !
Le voici :
eval "`dircolors -b`"
shopt -s histappend
shopt -s checkwinsize
####################
# ALIASES #
####################
# Colors
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias grep='grep --color=auto'
# Classic ls derivatives
alias lc='ls -C'
alias ll='ls -la'
alias lla='ls -laR'
# Paged ls
alias lll='ls -l | less'
# Security
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Print $PATH
alias path='echo $PATH'
# Edit the config files
alias bashrc='vi ~/.bashrc'
alias xdef='vi ~/.Xdefaults'
# Classic cd derivatives
alias cd..='cd ..'
alias ..='cd ..'
alias cd...='cd ../..'
alias ...='cd ../..'
alias cd....='cd ../../..'
alias ....='cd ../../..'
alias cd.....='cd ../../../..'
alias .....='cd ../../../..'
alias cd......='cd ../../../../..'
alias ......='cd ../../../../..'
alias old='cd $OLDPWD'
# Goto home
alias home='cd ~ && clear'
# Goto previous directory and ls
alias up='.. && ls'
# Quick aliases
alias md='mkdir'
alias c='clear'
alias p='pwd'
alias g='grep'
alias h='head'
alias t='tail'
alias r='cd /'
alias l='ls'
alias k='killall'
alias b='~/.bashrc'
alias tc='touch'
# For keyboard errors
alias xs='cd'
alias vf='cd'
# File owners
alias mine='chmod 700'
alias public='chmod 777'
# Other ls derivatives
alias ls..='ls ..'
alias ls...='ls ../..'
alias ls....='ls ../../..'
# Archives
alias targz='tar xzvf'
alias tarbz2='tar xjvf'
# GCC aliases
alias gccw='gcc -W -Wall -ansi -pedantic'
alias g++w='g++ -W -Wall'
alias gccopt='gccw -O0'
alias g++opt='g++w -O0'
alias gccmain='gccw main.c -o main'
alias g++main='g++w main.cpp -o main'
# The man command with other pagers than less
alias mrman='man -Pmore'
alias msman='man -Pmost'
alias prman='man -Ppr'
alias pgman='man -Ppg'
alias lvman='man -Plv'
alias cman='man -Pcat'
# All aliases
alias aliases='cat ~/.bashrc | grep alias'
# Grep derivatives
alias agrep='aliases | grep'
alias hgrep='history | grep'
alias lgrep='ls | grep'
alias pgrep='ps | grep'
# Terminal
alias term='urxvt'
alias cmd='urxvt -e'
# Apt-get aliases
alias inst='sudo apt-get install'
alias update='sudo apt-get update'
# Showing logs
alias logs='tail -f /var/log/system.log'
# Vim practices
alias :q='exit'
alias :wq='exit'
alias :q!='exit'
# Qt project compilation
alias qt='qmake -project && qmake && make'
####################
# FUNCTIONS #
####################
# Create a directory and go in it
function mkcd() { mkdir $1 && cd $1 }
# Save a file
function savefile() { cp $1 $1-`date +%H:%M:%S-%m%d%Y` }
# Take a screenshot
function screenshot() { scrot $1-`date +%H:%M:%S-%m%d%Y` }
# Use a trash
trash='~/trash/'
function del() { mv $1 $trash }
# Go into a directory and ls
function cdl() { cd $1 && ls -l }
# Grep functions
function ugrep() { grep $1 | uniq }
function mgrep() { grep $1 | more }
function lsgrep() { grep $1 | less }
function sgrep() { grep $1 | sort }
function umgrep() { grep $1 | uniq | more }
function ulgrep() { grep $1 | uniq | less }
function smgrep() { grep $1 | sort | more }
function slgrep() { grep $1 | sort | less }
function sumgrep() { grep $1 | sort | uniq | more }
function sulgrep() { grep $1 | sort | uniq | less }
####################
# COLORS #
####################
red='\e[0;31m'
RED='\e[1;31m'
green='\e[0;32m'
GREEN='\e[1;32m'
yellow='\e[0;33m'
YELLOW='\e[1;33m'
blue='\e[0;34m'
BLUE='\e[1;34m'
magenta='\e[0;35m'
MAGENTA='\e[1;35m'
cyan='\e[0;36m'
CYAN='\e[1;36m'
white='\e[0;37m'
WHITE='\e[1;37m'
export PS1='${debian_chroot:+($debian_chroot)}$white[ __ $blue -> \u$white@$blue\h <- $white___ $cyan[ \t ] $white___ in $blue\W $white__ ] $cyan\$ '
Je cherche l'erreur, en vain.
Merci d'avance.
Hors ligne
#2 Le 17/07/2010, à 08:38
- credenhill
Re : [bashrc] Unexpected end of file !
hello
mettre un ; à la fin des functions
function mkcd() { mkdir $1 && cd $1 ; }
Hors ligne
#3 Le 17/07/2010, à 10:03
- Shydow_BF
Re : [bashrc] Unexpected end of file !
Cela marche, merci beaucoup !
Hors ligne