Type the following command (to get ^M type CTRL+V followed by CTRL+M):
The substitute command can be used as follows too:
sed -e '/^M/d' input
sed -e '/^M/d' input > output
# gnu sed
sed -i -e '/^M/d' input
sed -e 's/^M//g' input
sed -e 's/^M//g' input > output
# gnu sed
sed -i -e 's/^M//g' input
# replace line feed with FOO
sed -i -e 's/^M/FOO/g' input
No comments:
Post a Comment