Now escaping the single quotes becomes the biggest challenge for me , i tried various solutions but they didn't work.
Below is the basic information of the environment on which i am working
1) When i type echo $shell , on my environment , it prints /bin/csh
But i am testing after creating a shell file that starts #!/bin/sh ,
When i tried as
#!/bin/sh
MyVAL="foo,bar,tar"
L=`echo $MyVAL |sed -e "s/'/'/g"`
echo $L
I got foo,bar,tar as echo result
When i changed L as L=`echo $MyVAL |sed -e "s/'/\'/g"` I still get foo,bar,tar as echo result
When i changed L as L=`echo $MyVAL |sed -e "s/'/\\'/g"` I still get foo,bar,tar as echo result
When i changed L as L=`echo $MyVAL |sed -e "s/'/\\\'/g"` I still get foo,bar,tar as echo result
When i changed L as L=`echo $MyVAL |sed -e "s/'/\\\\'/g"` I still get foo,bar,tar as echo result
When i changed L as L=`echo $MyVAL |sed -e "s/'/\\\\\'/g"` I still get foo,bar,tar as echo result
It seems that now my primary question is how can i replace comma by single quote , i tried my solutions by googling but din't find any answer
Can anyone please help in this regard.
Thank you in Advance.