Shellcheck: Repeat-only for loop without SC2034

Created on 3 Mar 2018  路  4Comments  路  Source: koalaman/shellcheck

I'd like to repeat something N times:
for UNUSED in {1..16}; do echo 1; done

but shellcheck tells me ^-- SC2034: UNUSED appears unused. Verify it or export it.

What could I do?

Most helpful comment

You can also use the name _. This is a feature in JS Python, Haskell and others, and semi-commonly used in sh in e.g. read foo _ bar

All 4 comments

I know-I know: # shellcheck disable=SC2034

You can also use the name _. This is a feature in JS Python, Haskell and others, and semi-commonly used in sh in e.g. read foo _ bar

Thank you for your continued support.

This was useful. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

balloonpopper picture balloonpopper  路  4Comments

bje- picture bje-  路  3Comments

sobolevn picture sobolevn  路  4Comments

hugovk picture hugovk  路  4Comments

bbarker picture bbarker  路  3Comments