|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
read data from a file
I have a data file like this:
A B C D 1 2 3 4 2 3 3 34 : : : : : : : : * * * * I want to read these number and assign them to some variables, something like: 1st time: var1=1, var2=2 var3=3, var4=4 then do something with these Var* then 2nd time var2=2, var2=3, var3=3 var4=34 then do something.... and so on. How to do it in C shell script? Thanks. cat |
|
#2
|
|||
|
|||
|
Code:
while read var1 var2 var3 var4 do // do stuff with your variables here done < my_data_file |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > read data from a file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|