From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,605aabdb8f59aaec X-Google-Attributes: gidfa528,public Path: controlnews3.google.com!postnews1.google.com!not-for-mail From: nikki_wire@yahoo.com (nikki_wire) Newsgroups: comp.unix.tru64 Subject: Re: A little UNIX scripting challenge... Date: 2 Jun 2004 02:40:00 -0700 Organization: http://groups.google.com Message-ID: <60fdd9c9.0406020140.30766c49@posting.google.com> References: <60fdd9c9.0405270723.33f51cc3@posting.google.com> <60fdd9c9.0405280812.730ddb8c@posting.google.com> NNTP-Posting-Host: 157.203.124.150 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1086169200 24053 127.0.0.1 (2 Jun 2004 09:40:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 2 Jun 2004 09:40:00 +0000 (UTC) Xref: controlnews3.google.com comp.unix.tru64:86 Well, if you know how to write an undewear detector, I'd be intrigued to know...! Actually what this is for is to decode some data from one of my company's applications - at the moment it's a prolonged manual process. Cheers for the start with it! Nikki nikki_wire@yahoo.com (nikki_wire) wrote in message news:<60fdd9c9.0405280812.730ddb8c@posting.google.com>... > Somehow I've messed up this thread - anyhow someone came up with a way > to do this - thanks Tybreaker! > > I was wondering if maybe anyone could help me take this one step > further. > > I'd like to take the output generated from Tybreaker's script and > format it as follows: > > First I'd like to remove all the spaces and then read the binary > output backwards and convert each 7 bit section into hex. > > eg: 01110000 11101010 10000001 > > will become: > > 1000000 => 40 > 1010101 => 55 > 1100001 => 61 > > etc etc.... > > Also, does anyone know a way to concatenate a file without any of the > character returns in the file - eg. make the output all stay on one > line? > > Thanks! > > Nikki > > > > nikki_wire@yahoo.com (nikki_wire) wrote in message news:<60fdd9c9.0405270723.33f51cc3@posting.google.com>... > > Hello! > > > > I am a UNIX novice but I'd like to write a script to decode some > > output - I was wondering if anyone could help me out with it? > > > > Here's what I'd like to do. > > > > I have some HEX output. eg. 81 ea 70 90 cd 05 8b 95 40 00 > > > > I'd like to convert that to strict 8 bit binary with a zero as the > > filler for the extra characters but starting from the last 2 digits > > and working backwards. > > So for the above it would become 00 40 95 8b 05 cd 90 70 ea 81 and > > then subsequently 00000000 01000000 10010101 10001011 00000101 > > 11001101 10010000 01110000 11101010 10000001 (I think that's right!) > > > > Does anyone have a way to do this? If so I'd appreciate it! > > > > Thanks > > > > Nikki