sed "s/[a-z]/$1/g" <old.txt>new.txt echo "done" This only replaces lowercase letters with the first parameter given. I want to replace everything except uppercase letters.
sed "s/[^[:upper:]]/$1/g" Would replace all characters that are not considered as an upper-case letter in your locale with the content of $1 (provided $1 doesn't contain &, backslash or slash or newline characters).
Note that it would not replace bytes that are not part of valid characters. It will also happily convert combining characters. For instance, É is an upper-case character. If written as the U+00C9 character, it will be left alone, but if written as E followed by the combining acute accent character (U+0301), that will be changed to E$1.