5

[QUESTION] Assign values read from a file into multiple variables

view full story
linux-howto

http://www.unix.com – Hi! I am new in linux shell scripting...but had some basics in C++ so trying to merge things together now...:) Ok, my problem goes like this: I know that if we want to read values from a file and assign them to variables, we can do this: Content of myfile.txt: 12 13 14 Code: read a b c < myfile.txt echo $a echo $b echo $c Then we will get an output like this: 12 13 14 However, what if I am unsure of how many values are there in a file?How to assign each of the values into seperate variables?Like if there are 5 values, there will be 5 variables, 6 values then 6 var (HowTos)