The following command works well on my shell :
for ((j=0; j<=24; j++))
do > $j.json
done
but having the following notification :
SC2039 In POSIX sh, arithmetic for loops are undefined.
I was wondering what would be the equivalent in POSIX in order not to have interpeting issues on other systems.
I guess the standards-compliant way of doing it would be something like this:
j=0
while [ $j -le 24 ]; do
true > "$j.json"
j=$(( j + 1 ))
done
Another way that should work in a POSIX shell:
for j in `seq 0 24`; do
...
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With