fork download
  1. #!/usr/bin/env bash
  2. INPUT1=foo
  3. INPUT2=bar
  4. EOL=$'\n'
  5.  
  6. echo "First approach"
  7. cat - <<< "${INPUT1}${EOL}${INPUT2}${EOL}"
  8. echo
  9. echo "Second approach"
  10. cat - <<< "$INPUT1"$'\n'"$INPUT2"$'\n'
Success #stdin #stdout 0s 19632KB
stdin
Standard input is empty
stdout
First approach
foo
bar


Second approach
foo
bar