‘Bash’ Archive

Bash: Command output to array of lines 2018-05-10 No Comments

We had a case at work were multi-line output of a command should be turned into an array of lines. Here’s one way to do it. Two Bash features take part with this approach: $’….’ syntax (a dollar right in front of a single-tick literal) activates interpolation of C-like escape sequences (see below) Bash variable […]