Bash Parsing environment variables with JQ JQ provides this nifty env input that enables you to reference environment variables using the JQ style query syntax. # prints all envs in JSON format jq -n env And you can use piping
Bash Bash capture STDOUT to variable without redirecting Capture CLI to a variable in a bash script without redirecting STDOUT. OUTPUT=$(command --foo "${BAR}" | tee >(cat - >&2))
Bash Search JSON array with JQ JQ is a powerful command-line JSON processing tool. It's super fast (C), provides solid documentation, and is easy to use. In this example, given a JSON object from a file, curl response; we
Bash Iterating over an array of bash variables I had a requirement for a bash script to check for required variables before running a function. Rather than creating a conditional block for each required variable (or in my case, needing to
Bash Bash completion for Consul nodes on Ubuntu After making the jump to Ubuntu as my preferred distribution, I've admittedly become addicted to bash completions (aka autocomplete, tab completion, typeahead). Bash completions provide immediate hints for common commands, and even the