This is not very, but as a universal solution, you can get around this with a named pipe.
From BashFAQ # 24 :
mkfifo mypipe printf '%s\n' "$msg" >mypipe & read -rabc <mypipe
printf more reliable / better than echo ; echo behavior changes between implementations if you have a message containing only, say, -E or -n .
However, for what you are doing here, you can simply use the parameter extension:
a=${msg%% *}; msg=${msg#* } b=${msg%% *}; msg=${msg#* } c=${msg%% *}; msg=${msg#* }
source share