Non-working code:
Code:
megic=0
tragic=0
while read file0
do
logic=$((tragic+1))
Shellcheck return:
Code:
logic=$((tragic+1))
^-- SC2034: logic appears unused. Verify it or export it.
In a very similar script:
Code:
while read item
do
wilde1=$((yeats+1))
#Likewise
file0=$item
Shellcheck returns no errors. Why? In script 1,
logic is used for the first time and defined by the
+1 incrementor, as is
wilde1 in the second. Why should it work in one but not in the other? (Full scripts are attached, before anyone complains they don't have the code.)
Carver