I'm trying to remove the =
and ]
characters using one sed command:
# echo "A=[A]" | sed s'/[=\]]/ /g'
A=[A]
Something is wrong with this syntax?
I Expect the following results from sed
# echo "A=[A]" | ....sed
A [A
You can use the '-e' flag to execute multiple substitutes, for example:
# echo "A = [A]" | sed -e 's/=//' -e 's/]//'
A [A
It might be possible to match both '=' and ']' in a single substitute but even if it is, I don't think it'll provide much benefit over using '-e'.
It's probably easier to use tr to do something like this as it doesn't involve messing with REs
echo "A=[A]<-" | tr "]=" " "
A [A <-
tr
. One of those "using the wrong tool (i.e, overly complex) for the job" situations.