Text Processing10 / 18
Up next

tee split output

#!/usr/bin/env bash

tmp=$(mktemp)
# tee writes stdin to the file AND passes it through
echo "logged line" | tee "$tmp"
echo "file now holds:"
cat "$tmp"
rm -f "$tmp" 
What you're solving

write to a file and stdout at once