I am trying to replace
: in a file on a Unix system using
However, it doesn't work. I cannot find a solution in similar sed related posts.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
You have an extra single quote, and, in fact, don't need the quotes at all. The underscore and the colon are not significant to the shell. You are asking
sed to match
'_'' (all four characters) and replace them with a colon.
$ echo "_This is a test_" | sed s/_/:/g :This is a test:
Not that quotes aren't a good idea...