X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=.bashrc;h=65f8e40d1dc8e5ca04d39156a908741d892fad34;hp=e1e845b4819957c2e2e1ab7df033a5ba2bd2bdd9;hb=7c9b10d7f5e3e34a6372699e6bc057c53c0d00e7;hpb=ec9aa28949a2f77784de13b3cc9778dc632741d3 diff --git a/.bashrc b/.bashrc index e1e845b..65f8e40 100644 --- a/.bashrc +++ b/.bashrc @@ -17,9 +17,10 @@ if [ -f /etc/bashrc ];then source /etc/bashrc;fi function _bash_profile_addpath # , { - _OPTIND="$OPTIND" + local _varname _dirpathname _opt_f _opt_s _opt_f=0;_opt_s=0 - OPTIND=1;while getopts fs got;do + unset OPTIND + while getopts fs got;do case "$got" in [fs]) eval "_opt_$got=1" ;; *) return 1 ;; @@ -35,8 +36,6 @@ function _bash_profile_addpath # , eval "$_varname=\"$_dirpathname:\${$_varname}\"" fi export "$_varname" - unset _varname _dirpathname _opt_f _opt_s - OPTIND="$_OPTIND";unset _OPTIND } # Use reverse order of preferred directories: @@ -120,7 +119,6 @@ export IGNOREEOF=10 export TMOUT=900 export EDITOR='vim' [ -x /bin/less ] && export PAGER='/bin/less -MMh5cis' -[ "`uname`" = "SunOS" ] || export LC_CTYPE=cs_CZ.ISO-8859-2 export PERL_MM_OPT="PERL=$HOME/bin/perlilib" [ "$UID" -ne 0 ] && export PERL_MM_OPT="$PERL_MM_OPT PREFIX=$HOME" for file in $HOME/.bookmarks.html;do @@ -130,9 +128,10 @@ for file in $HOME/.bookmarks.html;do export GREP_OPTIONS="--binary-files=without-match --directories=skip" if [ -n "$PS1" ];then # set only in interactive sessions export PS1='[bash]${LOGNAME}@${HOSTNAME}:${PWD}# ' - # kbd_mode -u # utf-8 - # export PS1='\[\017\033%G\]'"$PS1" # \017=std charmap, \033%G=utf-8 export PS1='\[\017\]'"$PS1" # \017=std charmap + export PS1='\[\033%G\]'"$PS1" # \033%G=utf-8 + # Do not: kbd_mode -u # utf-8 + # as it breaks keyboard state in X and it is not permitted for non-root. fi export MINICOM="-m -c on" # metakeys+color export HISTSIZE=100000 @@ -157,7 +156,9 @@ export ULIMITME_OPTS="" for i in "-m 100000" "-d 150000" "-v 200000";do (ulimit $i 2>/dev/null) && ULIMITME_OPTS="$ULIMITME_OPTS $i" done -function ulimitme { ulimit $ULIMITME_OPTS; }; export -f ulimitme +# Prevent: ulimit: -m 100000 -d 150000 -v 200000: invalid number +# by forcing our known $IFS value; eval(1) is needed to take $IFS to effect: +function ulimitme { IFS=" " eval "ulimit $ULIMITME_OPTS"; }; export -f ulimitme function grep {(unset grep; ( ulimitme; grep "$@"; ); );}; export -f grep function finame { find . -false ` awk );print pop @r while @ ulimit -c 0 set +H shopt -s mailwarn +unset OPTIND if [ -f "$HOME/.bashrc.local" ];then source "$HOME/.bashrc.local";fi