diff options
author | Scott Bronson <b.git@u32.net> | 2008-03-20 01:49:26 -0700 |
---|---|---|
committer | Scott Bronson <b.git@u32.net> | 2008-03-20 01:49:26 -0700 |
commit | 4f14253f34de8bc04da2072364b19f8135ec4730 (patch) | |
tree | fdc32e9f1d9b7593c484616845049d30e3855ea9 /pre-commit.d/30store-metadata | |
parent | 5ff7971fcef5f92d35f9ffc58358263f9cd9ba75 (diff) |
Turns out dash doesn't support ${string:substibution}. Use printf instead.
Diffstat (limited to 'pre-commit.d/30store-metadata')
-rwxr-xr-x | pre-commit.d/30store-metadata | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata index 5190a2c..fbd9096 100755 --- a/pre-commit.d/30store-metadata +++ b/pre-commit.d/30store-metadata @@ -6,9 +6,9 @@ set -e filter_unknown() { CMD=$1 while read line; do - if [ "${line:0:8+${#CMD}}" = "$CMD UNKNOWN" ]; then - # error message like "Bad owner for ./ppp/peers" - echo Bad "$2" for "${line:9+${#CMD}}" >&2 + # if the first n chars of $line equal "$CMD UNKNOWN "... + if [ "$(printf %.$((9+${#CMD}))s "$line")" = "$CMD UNKNOWN " ]; then + echo Bad "$2" for "$line" >&2 else echo "$line" fi |