Question : Shell script to read bytes from a file

Hello,

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!

Answer : Shell script to read bytes from a file

Submitted to PAQ with no points refunded (of 500)

DarthMod
Community Support Moderator
Random Solutions  
 
programming4us programming4us