Read one integer from a file, cannot find info
I have read three linux scripting tutorials and still cannot find the answer to this... To many of you this may sound too simple, but as a beginner I am having a real hard time finding out how to read a single integer stored in a file, to process its value thereafter. his is what I have:
# user at console types input data file name:
read fname1
# open fname1 and load integer to int1
open $fname1
read $fname1, int1
echo expr $int1 / 2
That's all I need to do, please help me with the syntaxt, I am following the tutorials but would like to know how to open, read a data element so I can do something with it before I go forward.
Thank you
|