You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To iterate over words written to a command or function's stdout, instead of for var in myfunction, use
forvarin$(myfunction);doecho"$var";done
To iterate over words in a variable, instead of for var in myvariable, use
forvarin$myvariable;doecho"$var";done
Rationale:
ShellCheck has detected that your for loop iterates over a single, constant value. This is most likely a bug in your code, caused by you not expanding the value in the way you want.
You should make sure that whatever you loop over will expand into multiple words.
Exceptions
If you stylistically choose to use for loops with a single element, e.g. to align with other code or to set up for future extensibility (for target in x86_64; do ..), you can ignore this warning.