From 4c08363b7f2fac102a2a7b0f6b1416c3758931e5 Mon Sep 17 00:00:00 2001 From: damage Date: Fri, 14 Jun 2024 21:29:15 +0200 Subject: [PATCH] use one type of execute replaced ` by $() --- s3h.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/s3h.sh b/s3h.sh index 2782c26..96764e2 100755 --- a/s3h.sh +++ b/s3h.sh @@ -15,7 +15,7 @@ if [[ $# -eq 1 && -d "$1" ]]; then START_DIR="$1" fi -START_DIR=`realpath "$START_DIR"` +START_DIR=$(realpath "$START_DIR") if [[ ! -d "$START_DIR" ]]; then echo "start directory '$START_DIR' does not exist" >&2 @@ -29,11 +29,11 @@ LAST="$START_DIR/.last" # check if there was a last call, if so fake while loop variable preselect='' if [[ -f "$LAST" ]]; then - last=`cat "$LAST"` + last=$(cat "$LAST") # check if config file still exists if [[ -f "$last" ]]; then - dir=`dirname "$last"` - preselect=`basename "$last"` + dir=$(dirname "$last") + preselect=$(basename "$last") fi fi @@ -53,12 +53,12 @@ while [[ -z "$configFile" ]]; do fi # add directory selectors - dirs=`find $dir -mindepth 1 -maxdepth 1 ! -name '.*' -type d -printf "%f\n" |sort` + dirs=$(find $dir -mindepth 1 -maxdepth 1 ! -name '.*' -type d -printf "%f\n" |sort) for d in $dirs; do para+=("$d" "<$d>") done # add file selectors - files=`find $dir -mindepth 1 -maxdepth 1 ! -name '.*' -type f -printf "%f\n" |sort` + files=$(find $dir -mindepth 1 -maxdepth 1 ! -name '.*' -type f -printf "%f\n" |sort) for d in $files; do # text before ~ is tag if [[ "$d" == *"~"* ]]; then @@ -97,7 +97,7 @@ while [[ -z "$configFile" ]]; do configFile=$ret fi else - dir=`dirname "$dir"` + dir=$(dirname "$dir") fi done @@ -125,7 +125,7 @@ if [[ -f "$configFile" ]]; then echo "$configFile" > "$LAST" # extract user@host if ~ in config file name - login=`basename "$configFile"` + login=$(basename "$configFile") if [[ "$login" == *"~"* ]]; then login="${login#*~}" fi