In this example
- Multiline input can be caputured by spreading openening and closing quote accross lines
- Newlines can be replaced using built-in bash text substitution
- The main trick is knowing that
$'\n'
is the way to specify the newling within the subsitution - Note, echo output of a var without quotation replaces newlines with spaces
$ t='1
> 2