I have a variable named myVar in bash with value as shown below.
'./favicon.png' './inc/sendEmail.php' './index.html' './images/header-background.jpg'
Note: the above code is the value of one variable
And I want want to change it to the below string by removing initial dot from each path
'/favicon.png' '/inc/sendEmail.php' '/index.html' '/images/header-background.jpg'
I am not able to figure out how to do this. Please help.
sed "s/'\./'/g" <<< "$string", but if you have any control over whatever generates the string, you should fix it where it's created, and also use an array instead of a string with hardcoded quotes, as any further processing tends to be more difficult with what you have.xyz./abcto be removed as well?