1

Extract a string from a file and store it in variable

view story
linux-howto

http://www.unix.com – Hi, I've a file ImageSizeDetails.txt with the following contents: Code: Image Name:  swncd 01.10.00.04 Created:      Wed Jan  9 14:05:48 2013 Image Type:  ARM Linux Multi-File Image (gzip compressed) Data Size:    7351011 Bytes = 7178.72 kB = 7.01 MB Load Address: 00008000 Entry Point:  00008000 Contents:   Image 0: 1672879 Bytes = 1633.67 kB = 1.60 MB   Image 1: 5678119 Bytes = 5545.04 kB = 5.42 MB I need to extract the size of Image 0 in bytes (i.e) 1672879 alone& save it in a variable. Kindly help me with a shell script (HowTos)