for
Shell Loop VarThe following is proof:
#!/bin/sh
port='56 56 345 hello;ls;'
for p in $port; do
echo "$p";
done
The echo
obviously needs quotes. But it’s not so obvious that $port
doesn’t need them, and, in fact, can’t have them if you want it to do
what it’s suppose to do (split on whitespace or IFS
). And shellcheck
confirms.