#!/usr/bin/env bash # $(...) runs a command and substitutes its stdout today=$(date +%Y-%m-%d) words=$(echo "one two three" | wc -w) echo "date=$today words=$words"
capture a command's output with $(...)