I have two scripted files, say file1
and file2
. I want to take the content of file1
, change character a
to A
in file1
and append the output to file2
without modifying the content of file1
. I'm trying with:
sed -i ‘s/a/A/g’ file1 >> file2
but this just changes the a
to A
in file1
.
y
command that is more idiomatic for single character replacements:sed 'y/a/A/' file1 >> file2
– steeldriver Sep 03 '22 at 17:45y
pose an advantage to using thes
command? – BeastOfCaerbannog Sep 03 '22 at 17:56tr
rather thansed
in this application. – steeldriver Sep 03 '22 at 18:18