Skip to content
Snippets Groups Projects
Commit 8f680b85 authored by Valentin Samir's avatar Valentin Samir
Browse files

[bashrc] Bon code de retour pour cd

parent 92d067f3
No related branches found
No related tags found
No related merge requests found
......@@ -98,11 +98,11 @@ get_vcs_info () {
# Rien de spécial n'arrivera si vous n'avez pas le fichier .umaskrc
function cd {
builtin cd "$@"
ret=$?
if [ -f ~/.umaskrc ]; then
umask $(/usr/bin/awk 'BEGIN {pwd=ENVIRON["PWD"]; a=length(pwd); cmax=0} {if($1==pwd) {MASK=$2;exit}; c=length($1); if(c>a) {next}; if(substr(pwd,0,c)==$1 && c > cmax) {cmax=c; MASK=$2}} END {print MASK}' ~/.umaskrc) >/dev/null
else
return 0
fi
return $ret
}
### Attention à ce que vous éditez dans cette section ###
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment