From: Oleg Broytman Date: Mon, 18 Jul 2016 06:28:03 +0000 (+0300) Subject: .shellrc: ${1:+"$@"} => "$@" X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=820fc2a245c910c03759bddca9bec8435b58c518;hp=50b9dfa17f24b869e9b1df2a982d5cbf8353423e;p=dotfiles.git .shellrc: ${1:+"$@"} => "$@" --- diff --git a/.shellrc b/.shellrc index 8389dd9..90442e0 100644 --- a/.shellrc +++ b/.shellrc @@ -65,9 +65,9 @@ if test -n "$BASH_VERSION"; then [ "`type -t ll`" = alias ] && unalias ll [ "`type -t mc`" = alias ] && unalias mc - back() { cd - ${1:+"$@"}; } + back() { cd - "$@"; } clo() { clear; logout; } - eval 'functions() { typeset -f ${1:+"$@"}; }' + functions() { typeset -f "$@"; } j() { jobs; } if [ -z "$BASH_COMPLETION_COMPAT_DIR" ]; then @@ -130,7 +130,7 @@ if test -n "$BASH_VERSION"; then #fi elif test -n "$KSH_VERSION" -o -n "$FCEDIT"; then - back() { cd - ${1:+"$@"}; } + back() { cd - "$@"; } clo() { clear; exit; } j() { jobs; } @@ -147,11 +147,11 @@ fi #PWd() { pwd | sed "s/.*\/\(.*\)\/\(.*\)/...\/\2/"; } -psg() { ps auxw | grep -i ${1:+"$@"} | grep -v '\(ps auxw\|grep\)'; } -pswg() { ps auxwww | grep -i ${1:+"$@"} | grep -v '\(ps auxw\|grep\)'; } +psg() { ps auxw | grep -i "$@" | grep -v '\(ps auxw\|grep\)'; } +pswg() { ps auxwww | grep -i "$@" | grep -v '\(ps auxw\|grep\)'; } # Like pgrep -f -pidOf() { ps auxwww | grep -i ${1:+"$@"} | grep -v '\(ps auxw\|grep\|pidOf\|KillAll\)' | awk '{print $2}'; } +pidOf() { ps auxwww | grep -i "$@" | grep -v '\(ps auxw\|grep\|pidOf\|KillAll\)' | awk '{print $2}'; } # A kind of pkill/killall KillAll() {