The <
and >
are stream redirection operators.
You do not need the <
operator because sed
accepts a filename argument after the sed command.
If you plan to save sed replacement result in a new file, >
is required. If you want to save the file contents "inline", there is no obligation to use >
either. With GNU sed
, you can do
sed -i 's:hello:world:g' "$templateFile"
With Free BSD sed
, you can do
sed -i '' 's:hello:world:g' "$templateFile"
Check the sed edit file in place question.
You do not need -e
either, it only signals that the next argument is the sed command.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…