Questions tagged [shellcheck]

shellcheck is a tool for automatically detecting shell script problems

Filter by
Sorted by
Tagged with
3
votes
2answers
142 views

Shellcheck complains that I should not to read and write the same file in the same pipeline

ShellCheck show the following error for this line of code: printf '%d' $(($(< "$1") + 1)) > "$1" Make sure not to read and write the same file in the same pipeline Is this really a problem? ...
6
votes
1answer
229 views

Unexpected outcome of a=“$@”

I'm struggling with this situation: $ set -- 1 2 3 $ a="$@" $ echo "$a" 1 2 3 What I find unexpected is the assignment itself. man bash says this about the "$@" expansion: When the expansion ...