diff options
author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-01-10 14:18:35 +0100 |
---|---|---|
committer | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-01-10 14:18:35 +0100 |
commit | 041b044a663a52e1c885c00496b44c5ba5982597 (patch) | |
tree | 78006e6e206200c47a704b25557d4bfcdaf684ed /lib | |
parent | b326f62dcf5713f1d10b4c03da36dfa06ee7a72d (diff) |
lib/path/tests: Fix property tests when "-n" is generated
When "-n" is generated by the property tests, it causes `echo` to not
output the string since it's interpreted as an option. Apparently
there's no good way to print "-n" with `echo` [1], so switching to
`printf` instead
[1]: https://unix.stackexchange.com/questions/85846/how-can-i-print-n-with-echo
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/path/tests/prop.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/path/tests/prop.sh b/lib/path/tests/prop.sh index c956e55bbfa0..e48c6667fa08 100755 --- a/lib/path/tests/prop.sh +++ b/lib/path/tests/prop.sh @@ -55,7 +55,7 @@ fi declare -a strings=() mkdir -p "$tmp/strings" while IFS= read -r -d $'\0' str; do - echo -n "$str" > "$tmp/strings/${#strings[@]}" + printf "%s" "$str" > "$tmp/strings/${#strings[@]}" strings+=("$str") done < <(awk \ -f "$SCRIPT_DIR"/generate.awk \ |