Skip to main content
2 of 2
added 311 characters in body
steeldriver
  • 83.8k
  • 12
  • 124
  • 175

You're reading lines, but you're not doing anything with what you read. Try:

#!/bin/sh

while read line
do
        printf '%s\n' "$line" | sed 's/<TEST>/FOO/'
done <&0

Also you may want to change the while read line to

while IFS= read -r line || [ -n "$line" ]

to ensure that you are reading everything as cat testfile.txt | sed 's/<TEST>/FOO/' would. See

steeldriver
  • 83.8k
  • 12
  • 124
  • 175