Re: imagemagick

Liste des GroupesRevenir à fco unix 
Sujet : Re: imagemagick
De : alain (at) *nospam* universite-de-strasbourg.fr.invalid (Alain Ketterlin)
Groupes : fr.comp.os.unix
Date : 22. Oct 2021, 10:05:39
Autres entêtes
Organisation : Université de Strasbourg
Message-ID : <87bl3h5vsc.fsf@universite-de-strasbourg.fr.invalid>
References : 1 2 3 4 5 6
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)
Thomas <fantome.forums.tDeContes@free.fr.invalid> writes:

$ for file in *.gif ; do convert "$file" "$(basename "$file"
_gif.gif).png" ; done
fonctionne très bien aussi :-)

Je ne vois pas très bien pourquoi utiliser basename ici (son rôle est en
général de supprimer la partie répertoire d'un chemin). Il suffit de
faire une expansion en supprimant le suffixe.

for file in *_gif.gif ; do convert "$file" "${file%_gif.gif}.png" ; done

J'ai aussi changé la liste du for : si tu as un fichier sans la partie
"_gif" tu récupérerais xxx.gif.png

-- Alain.

Date Sujet#  Auteur
18 Oct 21 * imagemagick26Thomas
18 Oct 21 +* Re: imagemagick24pehache
19 Oct 21 i`* Re: imagemagick23Thomas
19 Oct 21 i +* Re: imagemagick11Nicolas George
19 Oct 21 i i+- Re: imagemagick1Olivier Miakinen
20 Oct 21 i i`* Re: imagemagick9Thomas
20 Oct 21 i i `* Re: imagemagick8pehache
21 Oct 21 i i  `* Re: imagemagick7Thomas
22 Oct 21 i i   `* Re: imagemagick6pehache
30 Nov 21 i i    `* Re: imagemagick5Thomas
30 Nov 21 i i     `* Re: imagemagick4pehache
1 Dec 21 i i      `* Re: imagemagick3Thomas
19 Dec 21 i i       `* Re: imagemagick2Thomas
2 Jan 22 i i        `- Re: imagemagick1pehache
20 Oct 21 i `* Re: imagemagick11Thomas
20 Oct 21 i  +* Re: imagemagick4pehache
20 Oct 21 i  i`* Re: imagemagick3pehache
20 Oct 21 i  i `* Re: imagemagick2Benoit Izac
20 Oct 21 i  i  `- Re: imagemagick1pehache
20 Oct 21 i  `* Re: imagemagick6Benoit Izac
21 Oct 21 i   `* Re: imagemagick5Thomas
22 Oct 21 i    +* Re: imagemagick2Benoit Izac
30 Nov 21 i    i`- Re: imagemagick1Thomas
22 Oct 21 i    `* Re: imagemagick2Alain Ketterlin
30 Nov 21 i     `- Re: imagemagick1Thomas
19 Oct 21 `- Re: imagemagick1Nicolas George

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal