0

I'm trying to launch a small script which fixes a bug in iceweasel icons.

Here is the script. You can find it as a workaround in the bug report

for n in 16 32 48; do inkscape -z -w $n -h $n -e /usr/share/iceweasel/browser/chrome/icons/default/default${n}.png /usr/share/icons/hicolor/scalable/apps/iceweasel.svg; done for n in 16 32 48 64 128; do inkscape -z -w $n -h $n -e /usr/share/icons/hicolor/${n}x${n}/apps/iceweasel.png /usr/share/icons/hicolor/scalable/apps/iceweasel.svg; done 

I created a file tempiceweasel.sh with the few lines above. I gave it execute permission:

# chmod +x tempiceweasel.sh # ls -la tempiceweasel.sh -rwxr-xr-x 1 user user 349 mars 9 16:33 tempiceweasel.sh 

When I launched the script I have permissions errors:

# ./scripts/tempiceweasel.sh Nothing to do! ./scripts/tempiceweasel.sh: ligne 3: /usr/share/iceweasel/browser/chrome/icons/default/default16.png: Permission non accordée ./scripts/tempiceweasel.sh: ligne 4: /usr/share/icons/hicolor/scalable/apps/iceweasel.svg: Permission non accordée Nothing to do! ./scripts/tempiceweasel.sh: ligne 3: /usr/share/iceweasel/browser/chrome/icons/default/default32.png: Permission non accordée ./scripts/tempiceweasel.sh: ligne 4: /usr/share/icons/hicolor/scalable/apps/iceweasel.svg: Permission non accordée Nothing to do! ./scripts/tempiceweasel.sh: ligne 3: /usr/share/iceweasel/browser/chrome/icons/default/default48.png: Permission non accordée ./scripts/tempiceweasel.sh: ligne 4: /usr/share/icons/hicolor/scalable/apps/iceweasel.svg: Permission non accordée Nothing to do! ./scripts/tempiceweasel.sh: ligne 7: /usr/share/icons/hicolor/16x16/apps/iceweasel.png: Permission non accordée ./scripts/tempiceweasel.sh: ligne 8: /usr/share/icons/hicolor/scalable/apps/iceweasel.svg: Permission non accordée Nothing to do! ./scripts/tempiceweasel.sh: ligne 7: /usr/share/icons/hicolor/32x32/apps/iceweasel.png: Permission non accordée ./scripts/tempiceweasel.sh: ligne 8: /usr/share/icons/hicolor/scalable/apps/iceweasel.svg: Permission non accordée Nothing to do! ./scripts/tempiceweasel.sh: ligne 7: /usr/share/icons/hicolor/48x48/apps/iceweasel.png: Permission non accordée ./scripts/tempiceweasel.sh: ligne 8: /usr/share/icons/hicolor/scalable/apps/iceweasel.svg: Permission non accordée Nothing to do! ./scripts/tempiceweasel.sh: ligne 7: /usr/share/icons/hicolor/64x64/apps/iceweasel.png: Permission non accordée ./scripts/tempiceweasel.sh: ligne 8: /usr/share/icons/hicolor/scalable/apps/iceweasel.svg: Permission non accordée Nothing to do! ./scripts/tempiceweasel.sh: ligne 7: /usr/share/icons/hicolor/128x128/apps/iceweasel.png: Permission non accordée ./scripts/tempiceweasel.sh: ligne 8: /usr/share/icons/hicolor/scalable/apps/iceweasel.svg: Permission non accordée 

It seems I don't have the right to write files in these directories. I don't understand why; I'm running as root and the permissions of these files are all like the below:

-rw-r--r-- 1 root root 93 févr. 14 14:25 default16.png -rw-r--r-- 1 root root 325 févr. 14 14:25 default32.png -rw-r--r-- 1 root root 1845 févr. 14 14:25 default48.png 

Any ideas why I can't write these files?

1 Answer 1

4

The commands you copy-pasted were supposed to be single-line commands. Instead, they were broken into three lines each. So each command is the same as if you did:

# for n in 16 32 48; do inkscape -z -w $n -h $n -e # /usr/share/iceweasel/browser/chrome/icons/default/default${n}.png # /usr/share/icons/hicolor/scalable/apps/iceweasel.svg; done 

So basically, in each step of the loop, it's trying to run inkscape, then it is trying to run the image file as an executable, then it is trying to do the same for the svg file. The reason you got errors about permissions is, of course, that the images don't have execute permission. The "nothing to do" came from inkscape, which was missing its parameters.

The three lines should be all on the same line. Or the more appropriate way to write this, since you are writing a shell script rather than a single command, would be:

for n in 16 32 48 do inkscape -z -w $n -h $n -e \ /usr/share/iceweasel/browser/chrome/icons/default/default${n}.png \ /usr/share/icons/hicolor/scalable/apps/iceweasel.svg done 

Note the backslashes at the end of the lines - they mean the following line is a continuation of the current one. The same applies to the second loop.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.