Friday, 2 December 2022

Reminder - how to split strings in a shell script

There's almost certainly 73 different ways to do this, but this worked for me

The problem to be solved ... I have a string containing three container architectures: -

export architecture="amd64 s390x arm64"

and I want to split it into three, each on a newline

This does the needful: -

echo $architecture | tr ";" "\n"

rather nicely

No comments:

Note to self - Firefox and local connections

 Whilst trying to hit my NAS from Firefox on my Mac, I kept seeing errors such as:- Unable to connect Firefox can’t establish a connection t...