So I've started to make more use of cat and tee and the EOF symbol when creating documentation describing how one can create various different artefacts from, say, Bash on Linux and macOS.
Typically, I'm focusing upon configuration files e.g. files with .conf and .yaml but, a few days back, I wanted to create a Bash script.
Here's an example of what I'd do for a containerd.conf configuration file: -
Nice and simple, right ?
I then tried the same for a Bash script, here's a trivial example that munges a JSON document - me.json : -
"name": "Dave Hay",
called ./hello.sh created thusly: -
name=$(cat ~/me.json | jq -r .name)
echo "Hello, "$name