unix - Replacing a string with special characters -
i trying replace set of characters within variable.
var1=''abcd''
i want replace ''' pipe looks like.
|abcd|
i have tried below.
var1=$(sed 's/'/|/g' <<< $var1)
but not working. kindly me out.
edit: original answer incorrect formatted question.
this works
var1=$(echo "${var1}" | sed 's/'/|/g')
Comments
Post a Comment