X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc;h=2a770ae0e416297add55e9293f1779907f44681e;hb=774fe9ab8c8d5c71614feda5a283b4a91fb3f145;hp=ebbe38eab55b7d3e3debc8dc6e1d23b8cc279d71;hpb=46fb17d56b093264b69cc20192603da2604111ca;p=distro-setup diff --git a/brc b/brc index ebbe38e..2a770ae 100644 --- a/brc +++ b/brc @@ -426,15 +426,17 @@ utcl() { # utc 24 hour time to local hour 24 hour time } # c. better cd -if type -p wcd &>/dev/null; then - if [[ $LC_INSIDE_EMACS ]]; then - c() { wcd -c -z 50 -o "$@"; } +if ! type -t c &>/dev/null; then + if type -p wcd &>/dev/null; then + if [[ $LC_INSIDE_EMACS ]]; then + c() { wcd -c -z 50 -o "$@"; } + else + # lets see what the fancy terminal does from time to time + c() { wcd -c -z 50 "$@"; } + fi else - # lets see what the fancy terminal does from time to time - c() { wcd -c -z 50 "$@"; } + c() { cd "$@"; } fi -else - c() { cd "$@"; } fi ccomp cd c @@ -1118,7 +1120,7 @@ low() { # make filenames lowercase, remove bad chars fi f="${arg##*/}" new="${f,,}" # downcase - new="${new//[^[:alnum:]._-]/_}" # sub bad chars + new="${new//[^a-zA-Z0-9._-]/_}" # sub bad chars new="${new#"${new%%[[:alnum:]]*}"}" # remove leading/trailing non-alnum new="${new%"${new##*[[:alnum:]]}"}" # remove bad underscores, like __ and _._