I have an sed
command line which replaces ASCII 1 with |
:
sed -e 's/^A/\|/g' file_name
and this works. However, when I put it in a function in my bash file:
func(){
sed -e 's/^A/\|/g'
}
it doesn't work:
func file_name
just hangs, instead of displaying the file.
Have I made a mistake? I opened a new terminal so my bash was definitely loaded.
|
with a backslash. It doesn't have a special meaning in the replacement string. The superfluous backslash will usually do no harm, but\|
is undefined, so future versions ofsed
could give it some unwanted meaning.