diff options
Diffstat (limited to 'sh/shrc.d')
-rw-r--r-- | sh/shrc.d/ad.sh | 7 | ||||
-rw-r--r-- | sh/shrc.d/bd.sh | 7 | ||||
-rw-r--r-- | sh/shrc.d/pd.sh | 7 | ||||
-rw-r--r-- | sh/shrc.d/rd.sh | 7 | ||||
-rw-r--r-- | sh/shrc.d/sd.sh | 7 | ||||
-rw-r--r-- | sh/shrc.d/ud.sh | 7 |
6 files changed, 30 insertions, 12 deletions
diff --git a/sh/shrc.d/ad.sh b/sh/shrc.d/ad.sh index d3e5a90a..4916b0e6 100644 --- a/sh/shrc.d/ad.sh +++ b/sh/shrc.d/ad.sh @@ -65,10 +65,13 @@ ad() { done - # Print the target - printf '%s\n' "$dir" + # Print the target with trailing slash to work around newline stripping + printf '%s/' "${dir%/}" )" + # Remove trailing slash + set -- "${1%/}" + # If the subshell printed nothing, return with failure [ -n "$1" ] || return diff --git a/sh/shrc.d/bd.sh b/sh/shrc.d/bd.sh index 1043a8cb..bf64a9aa 100644 --- a/sh/shrc.d/bd.sh +++ b/sh/shrc.d/bd.sh @@ -55,10 +55,13 @@ bd() { exit 1 fi - # Print the target - printf '%s\n' "$dirname" + # Print the target with trailing slash to work around newline stripping + printf '%s/' "${dirname%/}" )" + # Remove trailing slash + set -- "${1%/}" + # If the subshell printed nothing, return with failure [ -n "$1" ] || return diff --git a/sh/shrc.d/pd.sh b/sh/shrc.d/pd.sh index de4ea23b..ce43837b 100644 --- a/sh/shrc.d/pd.sh +++ b/sh/shrc.d/pd.sh @@ -25,10 +25,13 @@ pd() { exit 1 fi - # Print the target - printf '%s\n' "$dirname" + # Print the target with trailing slash to work around newline stripping + printf '%s/' "${dirname%/}" )" + # Remove trailing slash + set -- "${1%/}" + # If the subshell printed nothing, return with failure [ -n "$1" ] || return diff --git a/sh/shrc.d/rd.sh b/sh/shrc.d/rd.sh index 9fd99a55..3b699c0d 100644 --- a/sh/shrc.d/rd.sh +++ b/sh/shrc.d/rd.sh @@ -51,10 +51,13 @@ rd() { exit 1 fi - # Print the target - printf '%s\n' "$new" + # Print the target with trailing slash to work around newline stripping + printf '%s/' "${new%/}" )" + # Remove trailing slash + set -- "${1%/}" + # If the subshell printed nothing, return with failure [ -n "$1" ] || return diff --git a/sh/shrc.d/sd.sh b/sh/shrc.d/sd.sh index ce59bf99..4d63b7d6 100644 --- a/sh/shrc.d/sd.sh +++ b/sh/shrc.d/sd.sh @@ -72,10 +72,13 @@ sd() { ;; esac - # Print the target - printf '%s\n' "$1" + # Print the target with trailing slash to work around newline stripping + printf '%s/' "${1%/}" )" + # Remove trailing slash + set -- "${1%/}" + # If the subshell printed nothing, return with failure [ -n "$1" ] || return diff --git a/sh/shrc.d/ud.sh b/sh/shrc.d/ud.sh index 44a3a81d..79f4b5e7 100644 --- a/sh/shrc.d/ud.sh +++ b/sh/shrc.d/ud.sh @@ -34,10 +34,13 @@ ud() { exit 1 fi - # Print the target - printf '%s\n' "$dirname" + # Print the target with trailing slash to work around newline stripping + printf '%s/' "${dirname%/}" )" + # Remove trailing slash + set -- "${1%/}" + # If the subshell printed nothing, return with failure [ -n "$1" ] || return |