diff options
Diffstat (limited to 'bin/hstow')
-rwxr-xr-x | bin/hstow | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |