Output read variable

Hi all, how read varaible and ouput in colum,

e.g.

$ echo $VAR1

opc op odi games gopher vcsa abrt

I like

$ echo $VAR1 

opc
op 
odi 
games 
gopher 
vcsa 
abrt

Thanks,

Please use code tags as required by forum rules!

That depends on VAR1's contents. If created with "\n" separators, use double quotes when using ( echo ing) the variable.
If it just contains spaces, try echo $VAR1 | tr ' ' $'\n' .

1 Like

Another way:

printf "%s\n" $VAR

More efficient since it doesn't require any externals.

thanks just perfect

and sorry for code,

you are genius

---------- Post updated at 08:02 AM ---------- Previous update was at 08:00 AM ----------

thanks corona perfect

thanks all,