sed replace with variable in file first line code example
Example 1: sed replace in file
sed -i 's/foo/bar/g' hello.txt
Example 2: sed replace first in file
sed '0,/REPLACESTHIS/s//WITHTHAT/' myfile.txt
sed -i 's/foo/bar/g' hello.txt
sed '0,/REPLACESTHIS/s//WITHTHAT/' myfile.txt