line="touch : touch : test.txt"
IFS=':' read scr cmd <<< "$line"
echo $scr
echo $cmd
output:
touch
touch : test.txt
line="touch : touch : test.txt"
IFS=':'
read scr cmd <<< "$line"
echo $scr
echo $cmd
output:
touch
touch test.txt
I don't understand how the second syntax makes read remove the ':' . Any ideas?