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
# For bash
IFS=""read -r -a array <<<"$var"# For ksh
IFS=""read -r -A array <<<"$var"
Rationale:
You are expanding a variable unquoted in an array. This will invoke the shell's sloppy word splitting and glob expansion.
Instead, prefer explicitly splitting (or not splitting):
If the variable should become a single array element, quote it.
If you want to split into lines or words, use mapfile, read -ra and/or while loops as appropriate.
This prevents the shell from doing unwanted splitting and glob expansion, and therefore avoiding problems with data containing spaces or special characters.
Exceptions:
If you have already taken care (through setting IFS and set -f) to have word splitting work the way you intend, you can ignore this warning.