Re: A little UNIX scripting challenge...

From: nikki_wire (nikki_wire_at_yahoo.com)
Date: 05/28/04

  • Next message: nikki_wire: "Re: A little UNIX scripting challenge..."
    Date: 28 May 2004 04:26:25 -0700
    
    

    Thanks very much indeed for this - that is brilliant.

    I wonder if I could push my luck and ask if you or anyone is able to
    extend this script to decode the data a little further.

    With the output you generated with your script, I'd like to remove all
    the spaces and split the data into 7 bit chunks starting from the end.
    These 7 bit chunks would then be decoded back to hex. So for our
    example: 00000000 01000000 10010101 10001011 00000101 11001101
    10010000 01110000 11101010 10000001 becomes:

    1000000 => 40
    1010101 => 55
    1100001 => 61

    Well, that's the first 3 anyway but you get the idea...

    I am sorry I am not able to work this out for myself - as I said I am
    a UNIX novice.

    Thanks very much!

    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


  • Next message: nikki_wire: "Re: A little UNIX scripting challenge..."

    Relevant Pages

    • A little UNIX scripting challenge...
      ... I am a UNIX novice but I'd like to write a script to decode some ... Nikki ...
      (comp.unix.tru64)
    • Re: decoding MIME:Base64 question?
      ... I use the following script, decode_base64.pl to decode back ... To get your code snippets to work for me I needed to 'binmode' the read ... I suspect the newlines are being included in $buf which is being base64 ...
      (perl.beginners)
    • Re: based64 decoding in javascript
      ... decoded script was executed in browser. ... can read it, then decode and execute. ... var base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ...
      (comp.lang.javascript)
    • [9fans] acme mail on unix
      ... It's not actually the Mail from Plan 9. ... is a shell script. ... default message filter for `show' ... Subject: decode ...
      (comp.os.plan9)
    • Re: A little UNIX scripting challenge...
      ... Actually what this is for is to decode some data from one ... Nikki ... > output backwards and convert each 7 bit section into hex. ... >> I am a UNIX novice but I'd like to write a script to decode some ...
      (comp.unix.tru64)