i'm trying run simple shell script example:
str="qwe;ert;rty;tii" ifs=';' read -r names <<< "$str"
this giving me following error message:
syntax error: got <&, expecting word
i'm not sure why isn't working. thought syntax used correct , tried comparing other examples , saw syntax identical.
any feedback help
thanks
this mks bash, not gnu bash. it's not bash, , doesn't support genuine shell's syntax.
there (...well, reasonably adequate) builds of gnu bash windows. use them.
particularly, in real bash, split semicolon-separated string array of names:
str='qwe;ert;rty;tii' ifs=';' read -r -a names <<<"$str"
...which can verify with
declare -p names
or emit one-to-a-line with
printf '%s\n' "${names[@]}"
Comments
Post a Comment