X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=brc;h=51a04dcac0d59c3a29bd081522ee11a51dc738da;hp=b5d45969c67b9364d6dfc783d187be1873d27707;hb=7f759d320592e791a62cd0a966350e8c53ee0976;hpb=165008e5b82c81ebff1061c8f8294c3bc6e9dced diff --git a/brc b/brc index b5d4596..51a04dc 100644 --- a/brc +++ b/brc @@ -317,7 +317,7 @@ cam() { ccat () { # config cat. see a config without extra lines. - grep '^\s*[^;[:space:]#]' "$@" + grep '^\s*[^;[:space:]#]' "$@" || [[ $? == 1 ]] } @@ -768,11 +768,11 @@ lower() { # make first letter of filenames lowercase. k() { # history search - grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history} | tail -n 80; + grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history} | tail -n 80 || [[ $? == 1 ]]; } ks() { # history search - grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history} | uniq; + grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history} | uniq || [[ $? == 1 ]]; } @@ -812,7 +812,7 @@ pkx() { # package extract c $(mktemp -d) pkg=$1 # shellcheck disable=SC2012 - cached=$(ls -t /var/cache/apt/archives/$pkg* | tail -n1 2>/dev/null) + cached=$(ls -t /var/cache/apt/archives/$pkg* | tail -n1 2>/dev/null) ||: if [[ $cached ]]; then cp $cached . else