Combining echo and cat on Unix July 25, 2023 by Tarik This should work: echo "PREPENDED STRING" | cat - /tmp/file | sed 's/test/test2/g' > /tmp/result