Split string and extract variables with shell script