Space delimited variables

I have a shell script where I am using space delimited variables.
Var=" ${var} data1 table1 "
Var=" ${var} data2 table2 "
Var=" ${var} data3 table3 "
Var=" ${var} data4 table4 "

I am using a single variable to store multiple values so I can use them in for loop. Each value contains space in them. I tried using IFS=' ' but it affects my print statement in the script. Anyother way I can follow to use my space delimited variable values

You can't have a delimiter occurring in your data. Use either a diffenrent delimiter (e.g. <TAB> = \t = 0x09), or an array.

2 Likes