Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 594  / 2 Years ago, sun, june 12, 2022, 5:23:44

Why doesn't this work?



rm $(gsettings get org.gnome.desktop.background picture-uri  | awk '{gsub("file://","");print $0}')
rm: cannot remove `'/home/foggy/obrazky/wallpapers/24/Dark_Oxygen_by_Falco101.png'': No such file or directory


Perhaps there is some character that rm doesn't accept?


More From » bash

 Answers
0

Look closely and you'll notice that it has embedded single quotes, which you will have to remove yourself. I would change the awk to a sed:



rm $(gsettings get org.gnome.desktop.background picture-uri |
sed -e "s/'//g" -e 's,file://,,g')


(Although actually I would look at exactly what the unmodified output of gsettings looks like first, so as to make something a bit more bulletproof.)


[#38526] Monday, June 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mouedi

Total Points: 420
Total Questions: 109
Total Answers: 116

Location: Philippines
Member since Wed, Aug 19, 2020
4 Years ago
;