Hi, I want to replace a string of directory path in a string to empty:
j=$(echo "/mnt/sda1/record/test/somefile.test"|sed 's/$STRING//g')
But this doesnt seem to give me the desired thing:
j=$(echo "/mnt/sda1/record/test/somefile.test"|sed 's/\/mnt\/sda1\/record\/test\///g')
this gives the desired outcome, but its specific, i need a variable in the sed not a string. And if I replace STRING="\/mnt\/sda1\/record\/$dd\/" then I cant use it for something else, cause its has all the weird backslashes now.