[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: question about net address



On Sun 19 Mar 2023 at 08:25:28 (-0400), Greg Wooledge wrote:
> On Sun, Mar 19, 2023 at 12:45:06PM +0100, Nicolas George wrote:
> > #!/bin/sh
> > eval "$(recode b64..data <<EOF | gunzip
> > H4sIACv1FmQAAzXMPQrCQBAG0H5O8TFEMII/BA3BVF7AXoLFsI5kCdl1d5JC8PCSIuVrnro+gm82
> > QPBVO4aINKtNPoYrU1Z5YZ+RyIkpuNh+sg/TG7wxRpHwg/VSXWqbx5LhA6E7Vee6EafPXQld9ofa
> > oW0Jq+9xoZo4+gNQ3NCSfgAAAA==
> > EOF
> > )"
> 
> Using recode instead of base64 to do a base64 decoding is... a choice.
> I wonder how many people have recode installed.

Here, yes, but I always used an alias written so long ago (for
ISO-8859-1..UTF-8) that I hadn't ever thought about using it
for base64. (My alias's name is a reminder that it overwrites
whenever filenames are given.)

> Within the "script" itself, you have:
> 
> case "$(printf "%s" $q | sha256sum)" in
> 
> This line is fascinating because you've used quotes twice where they
> aren't needed and failed to use them in the one place they're required.

I'd be surprised if people ran the above without first cutting/pasting
and line-editing it to something like:

 $ recode b64..data <<EOF | gunzip | hexdump -C
   H4sIACv1FmQAAzXMPQrCQBAG0H5O8TFEMII/BA3BVF7AXoLFsI5kCdl1d5JC8PCSIuVrnro+gm82
   QPBVO4aINKtNPoYrU1Z5YZ+RyIkpuNh+sg/TG7wxRpHwg/VSXWqbx5LhA6E7Vee6EafPXQld9ofa
   oW0Jq+9xoZo4+gNQ3NCSfgAAAA==
   EOF

(very simply done when using bracketed paste, of course).

Cheers,
David.


Reply to: