summaryrefslogtreecommitdiff
path: root/bin/hstow
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2023-01-17 12:13:10 -0700
committerSean Whitton <spwhitton@spwhitton.name>2023-01-17 12:13:40 -0700
commit67849a1c42de52b225cae5b50f93aa5ec1cb4b79 (patch)
treeef6419547b51fde6f94b5b0632ca58d6697d8edc /bin/hstow
parent6cf25a57debb9ed65e45c358d9c5fad43fcb75e3 (diff)
downloaddotfiles-67849a1c42de52b225cae5b50f93aa5ec1cb4b79.tar.gz
attempt to improve readability
Diffstat (limited to 'bin/hstow')
-rwxr-xr-xbin/hstow5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/hstow b/bin/hstow
index 21cbeca6..311fce2a 100755
--- a/bin/hstow
+++ b/bin/hstow
@@ -43,9 +43,10 @@ if ! command -v readlink >/dev/null; then
# We want the ninth field onwards in awk's sense --
# i.e. collapsing multiple runs of blanks between the first nine
# fields -- but we mustn't collapse blanks from there onwards.
+ n=$((3 + $(echo "$1" | wc -m)))
ls -ld "$1" \
- | sed -E 's/^[[:blank:]]*([^[:blank:]]+[[:blank:]]+){8}.{'$((
- 3 + $(echo "$1" | wc -m)))'}//'
+ | sed -E \
+ "s/^[[:blank:]]*([^[:blank:]]+[[:blank:]]+){8}.{$n}//"
}
fi