Shell script to read bytes from a file
Posted on 2005-03-14
Could someone please give me an example (if this is possible), of how to read a file using a uCLinux shell script to read a data file.
Specifically, the file contains two 4-byte records. I would like to read each byte into an individual variable, and then take an action, depending on the byte value. For example, if the value of the first byte = 0x01, run program x, if it is 0x02, run program y etc.
Since I am still new to Linux, a detailed example would be appreciated.
Thanks in advance!