X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=bashrc;h=4ae13cb788fcf8c440a99195559581f9ee8ee447;hb=17c692cb4145a9a3f67d1e9cbcd0ac81d28c0b62;hp=cb98ffa989b7737ef22149af1ec80ec77853a34a;hpb=2ef9154eec1d4732fc9bbad47b66f48854fa3ce6;p=scripts.git diff --git a/bashrc b/bashrc index cb98ffa..4ae13cb 100644 --- a/bashrc +++ b/bashrc @@ -23,11 +23,11 @@ PRIVATE_BASHRC="${HOME}/private/bashrc.perso" # If the MANPATH is not set, set it -[ "${MANPATH}" ] || MANPATH=$(manpath) +[[ "${MANPATH}" ]] || MANPATH=$(manpath) # If the private bashrc exists, execute it -[ -f "${PRIVATE_BASHRC}" ] && source "${PRIVATE_BASHRC}" +[[ -f "${PRIVATE_BASHRC}" ]] && source "${PRIVATE_BASHRC}" # !!! THIS HAS TO BE HERE EVEN IN THE NON-INTERACTIVE PART OR YOU WILL # LOSE YOU PREVIOUS HISTORY !!! @@ -168,7 +168,9 @@ function latexdiff () { # corresponding tex file function rl () { - RECENT_LOG=$(ls -t $(find -maxdepth 1 -name "*.log" -type f) | head -1) + # RECENT_LOG=$(ls -t $(find -maxdepth 1 -name "*.log" -type f) | head -1) + + RECENT_LOG=$(ls -t *.log | head -1) if [[ ${RECENT_LOG} ]]; then FILEBASE="${RECENT_LOG/.log/}" @@ -238,10 +240,11 @@ function bak () { done } -# Password generator +# A password generator -function pwgen () { +function genpw () { tr -dc A-Za-z0-9 < /dev/urandom | head -c16 + # tr -dc [:graph:] < /dev/urandom | head -c16 echo } @@ -540,12 +543,12 @@ function keep () { # I sometime burn CDs and DVDs function burn () { - DEVICE="/dev/cdrw1" + [[ "${DEV_BURNER}" ]] || DEV_BURNER="/dev/sr0" if [[ ! "$1" ]]; then echo "burn " >&2 elif [[ -f "$1" ]]; then if [[ $(file "$1" | \grep -E 'ISO 9660|UDF filesystem data') ]]; then - wodim -eject -v dev=${DEVICE} "$1" + wodim -eject -v dev=${DEV_BURNER} "$1" else echo "Do not know what to do with $1" >&2 fi @@ -554,7 +557,7 @@ function burn () { echo "Using ${TMP_ROOT} as temporary directory." TMP=$(mktemp ${TMP_ROOT}/cdimage.XXXXXX) && \ genisoimage -input-charset iso8859-1 -r -o ${TMP} "$1" && \ - wodim -eject -v dev=${DEVICE} ${TMP} + wodim -eject -v dev=${DEV_BURNER} ${TMP} rm -f ${TMP} else echo "Can not find $1" >&2 @@ -623,6 +626,12 @@ alias ripcd=abcde function mksmall () { + if [[ "$1" == "--params" ]]; then + shift + PARAMS="$1" + shift + fi + [[ "${PARAMS}" ]] || PARAMS="-geometry 800x600" # Auto-orient does not seem to work at all, hence the ugly hack @@ -781,6 +790,8 @@ alias finddup='finddup -p' # # git clone http://fleuret.org/git/selector/ +export SELECTOR_CD_HISTORY_SIZE=10000 + source bash-selector.sh --hist --cd ###################################################################### @@ -852,6 +863,9 @@ function lsn () { ###################################################################### function prompt_command () { + # if [[ $(umask) != 0022 ]]; then + # echo "Umask changed to $(umask)" + # fi # save the history after every command to avoid loosing some when # multiple shells are open history -a