From 76f0fa3a743dcdb4c15cd6c0d8ae81860879702e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?imme=C3=ABmosol?= Date: Sat, 13 Jan 2024 20:19:14 +0100 Subject: [PATCH] printf for bash also does not have an extended format with placeholder for each argument --- SC2031.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SC2031.md b/SC2031.md index 218bfe7..9468d8a 100644 --- a/SC2031.md +++ b/SC2031.md @@ -21,7 +21,7 @@ echo $n In `sh`, temporary files, FIFOs or file descriptors can be used instead. When the output of the command can be stored to a variable before entering the loop, here documents are a preferable alternative: ```sh n=0 -SUMMANDS="$(printf '%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n' 1 2 3 4 5 6 7 8 9 10)" +SUMMANDS="$(printf '%s\n' 1 2 3 4 5 6 7 8 9 10)" while read i; do n=$(( n + i )); done <