[GTALUG] Processing a binary file with a shell script

Brent Kimberley Brent.Kimberley at Durham.ca
Mon Aug 10 14:42:59 UTC 2015


How about ihex or srec?


  Original Message
From: Giles Orr
Sent: Monday, August 10, 2015 10:32
To: GTALUG Talk
Reply To: GTALUG Talk
Subject: Re: [GTALUG] Processing a binary file with a shell script


On 10 August 2015 at 04:12, Ansar Mohammed <ansarm at gmail.com> wrote:
> Hello All,
> I am writing a bourne shell script, to read a binary file as input and take
> action depending on the contents of the file.
>
> The file is a mixture of ASCII and binary codes (such as ASCII filed lengths
> and flags).
>
> I have the processing already done in C. I would like to convert it to a
> bourne shell.
>
> Does anyone have any suggestions on what combination of tools I may be able
> to use?

If you're only trying to look at the ASCII data (and trying to process
binary data in Bash seems like a poor idea), then you may want to look
at the "strings" command:

$ strings $(which ls)

"strings" is part of the binutils package on Debian.

--
Giles
http://www.gilesorr.com/
gilesorr at gmail.com
---
Talk Mailing List
talk at gtalug.org
http://gtalug.org/mailman/listinfo/talk
THIS MESSAGE IS FOR THE USE OF THE INTENDED RECIPIENT(S) ONLY AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, PROPRIETARY, CONFIDENTIAL, AND/OR EXEMPT FROM DISCLOSURE UNDER ANY RELEVANT PRIVACY LEGISLATION. No rights to any privilege have been waived. If you are not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying, conversion to hard copy, taking of action in reliance on or other use of this communication is strictly prohibited. If you are not the intended recipient and have received this message in error, please notify me by return e-mail and delete or destroy all copies of this message.


More information about the talk mailing list