Tuesday, 1 March 2022

More fun with variables and spaces, with added jq

Following on from my earlier post: -

Fun with variables and space

I thought I'd have a little fun using jq to achieve a similar outcome, but without the need to munge the output using sed.

This is with what I came up: -

export my_version=$(ic ks versions --output JSON | jq -j '.kubernetes[] | select(.minor | contains(23)) | .major,".",.minor,".",.patch')

which, you have to admit, is definitely NOT shorter than the alternative, but way more fun.

echo $my_version                                                                                                                        

1.23.4

echo $my_version | hexdump

0000000 31 2e 32 33 2e 34 0a                           
0000007

No comments:

Reminder - installing podman and skopeo on Ubuntu 22.04

This follows on from: - Lest I forget - how to install pip on Ubuntu I had reason to install podman  and skopeo  on an Ubuntu box: - lsb_rel...