From fec3a5381bee409e2d630b86200621f9aa37dfaf Mon Sep 17 00:00:00 2001 From: fatalerrors Date: Sun, 31 Jul 2022 22:17:33 +0200 Subject: [PATCH] minor style consistency --- profile.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/profile.sh b/profile.sh index 132f94b..313ca87 100644 --- a/profile.sh +++ b/profile.sh @@ -469,7 +469,8 @@ export -f ppg # ------------------------------------------------------------------------------ # Create a directory then goes inside # ------------------------------------------------------------------------------ -mcd () { +mcd () +{ if [[ ! $# -eq 1 ]] ; then echo "Create a directory then goes inside." echo "Usage: mcd " @@ -482,7 +483,8 @@ export -f mcd # ------------------------------------------------------------------------------ # Get PID list of the given process name # ------------------------------------------------------------------------------ -gpid () { +gpid () +{ [[ $UID -eq 0 ]] && local psopt="-A" [[ $# -eq 1 ]] && local single=1 for pid in $@; do @@ -501,7 +503,8 @@ export -f gpid # ------------------------------------------------------------------------------ # Remove host from know_host (name and IP) for the active user # ------------------------------------------------------------------------------ -rmhost () { +rmhost () +{ if [[ "$#" -lt 1 ]]; then echo "Error: incorrect number of parameters." echo "Usage: rmhost [hostname2|ip2 [...]]" @@ -545,7 +548,8 @@ export -f rmhost # ------------------------------------------------------------------------------ # Rename all files in current directory to replace spaces with _ # ------------------------------------------------------------------------------ -rmspc () { +rmspc () +{ local lst="" for opt in $@ ; do case $opt in @@ -944,7 +948,8 @@ export -f taz # ------------------------------------------------------------------------------ # Display system general information # ------------------------------------------------------------------------------ -showinfo() { +showinfo() +{ echo -e "\n" if command -v figlet >/dev/null 2>&1; then figlet -k $(hostname) @@ -1041,7 +1046,7 @@ settrace () for opt in $@ ; do case $opt in "-h"|"--help") - echo "Try to activate bactrace display for script debugging." + echo "Try to activate backtrace display for script debugging." echo echo "Options:" echo " --on Activate backtrace generation"