This is the way
sed -i 's/home/$USER/.config/hello_there//g' /home/$USER/.gnomerc
But, as far as I saw you cannot add any "/" in the string you want to remove....
So, what should I do in order to remove this path (which contains "/") ?
This is the way
sed -i 's/home/$USER/.config/hello_there//g' /home/$USER/.gnomerc
But, as far as I saw you cannot add any "/" in the string you want to remove....
So, what should I do in order to remove this path (which contains "/") ?
sed -i 's#home/$USER/.config/hello_there##g' /home/$USER/.gnomerc
Amm, thanks, this worked supposing you know the name of the Variable $USER....
e.g.
sed -i 's#home/alex/.config/hello_there##g' /home/$USER/.gnomerc #WORKS
sed -i 's#home/$USER/.config/hello_there##g' /home/$USER/.gnomerc #DOESN'T WORK
sed -i "s#home/$USER/.config/hello_there##g" /home/$USER/.gnomerc
Always solving one problem at a time
Use double quotes :):
sed -i "s#home/$USER/.config/hello_there##g" /home/$USER/.gnomerc
Thank you all.
# sed -i 's/home\/'$USER'\/.config\/hello_there//g' /home/$USER/.gnomerc
Thanks, this solution works as well.