logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git
commit: a3a4ff8fc4b9f267ca1081ebb92e5d07152d6863
parent 2e359bc4bbe8c7a3d386c9f85d03c7cf4d8bd5df
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 28 Sep 2024 13:11:29 +0200

test-cmd/head: directly pass /dev/zero instead of shell redir

Diffstat:

Mtest-cmd/head.sh6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test-cmd/head.sh b/test-cmd/head.sh @@ -40,12 +40,12 @@ t z3 "-n 3 -z ${WD}/test-cmd/inputs/strings/length" "$(printf '1\0_2\0__3\0')" set -o pipefail -head_40c() { </dev/zero "$target" -c 40 | wc -c | tr -d '[:space:]'; } +head_40c() { "$target" -c 40 /dev/zero | wc -c | tr -d '[:space:]'; } t_cmd 40c '40' head_40c -head_40kc() { </dev/zero "$target" -c 40k | wc -c | tr -d '[:space:]'; } +head_40kc() { "$target" -c 40k /dev/zero | wc -c | tr -d '[:space:]'; } t_cmd 40c '40960' head_40kc -head_40d() { </dev/zero "$target" -c 40d | wc -c | tr -d '[:space:]'; } +head_40d() { "$target" -c 40d /dev/zero | wc -c | tr -d '[:space:]'; } t_cmd --exit=1 40d "head: error: Unrecognised unit 'd' 0" head_40d