Posté par antoine.martin26 le 05 décembre 2012 à 09:00. En réponse au message point d'exclamation dans une variable. Évalué à 1.
En ajoutant "set +H" dans ~/.bashrc cela semble fonctionner.
A bon, entendeur…
Posté par antoine.martin26 le 04 décembre 2012 à 17:04. En réponse au message point d'exclamation dans une variable. Évalué à 1.
Bon en fait c'est cygwin qui déraille… Sur le "vrai" bash ça fonctionne bien…
Posté par antoine.martin26 le 04 décembre 2012 à 16:31. En réponse au message point d'exclamation dans une variable. Évalué à 1. Dernière modification le 04 décembre 2012 à 16:36.
Je vais être un peu plus exhaustif alors!
la commande que j’exécute est : find . -iname "*.tif" -type f -printf "%f\0" | xargs -I {} -0 -n 1 -P 4 convert -resize "$aspect" {} -resize "$taille" -gravity center -background black -extent "$taille" -alpha off -depth 8 -type truecolor {}
d'après un "ps -edf" lorsqu'elle est exécutée, elle est interprétée comme cela: find . -iname "*.tif" -type f -printf "%f\0" | xargs -I {} -0 -n 1 -P 4 convert -resize x! {} -resize 1998x1080 -gravity center -background black -extent 1998x1080 -alpha off -depth 8 -type truecolor {}
Ce qui est étrange, c'est que ma variable $taille est bien interprétée mais pas la variable $aspect.
Voici comment j'initialise mes variables:
case $3 in scope)format="S" && taille="2048x858";; flat)format="F" && taille="1998x1080";; esac
ratio=mediainfo --Inform="Video;%DisplayAspectRatio%" ../"$1" hauteur=mediainfo --Inform="Video;%Height%" ../"$1" hauteur=$hauteur! largeur=$(echo "$hauteur*$ratio" | tr -d $'\r' | bc | cut -d"." -f1) aspect="${largeur}x${hauteur}"!
mediainfo --Inform="Video;%DisplayAspectRatio%" ../"$1"
mediainfo --Inform="Video;%Height%" ../"$1"
[^] # Re: point d'exclamation dans une variable
Posté par antoine.martin26 . En réponse au message point d'exclamation dans une variable. Évalué à 1.
En ajoutant "set +H" dans ~/.bashrc cela semble fonctionner.
A bon, entendeur…
[^] # Re: point d'exclamation dans une variable
Posté par antoine.martin26 . En réponse au message point d'exclamation dans une variable. Évalué à 1.
Bon en fait c'est cygwin qui déraille… Sur le "vrai" bash ça fonctionne bien…
# point d'exclamation dans une variable
Posté par antoine.martin26 . En réponse au message point d'exclamation dans une variable. Évalué à 1. Dernière modification le 04 décembre 2012 à 16:36.
Je vais être un peu plus exhaustif alors!
la commande que j’exécute est :
find . -iname "*.tif" -type f -printf "%f\0" | xargs -I {} -0 -n 1 -P 4 convert -resize "$aspect" {} -resize "$taille" -gravity center -background black -extent "$taille" -alpha off -depth 8 -type truecolor {}
d'après un "ps -edf" lorsqu'elle est exécutée, elle est interprétée comme cela:
find . -iname "*.tif" -type f -printf "%f\0" | xargs -I {} -0 -n 1 -P 4 convert -resize x! {} -resize 1998x1080 -gravity center -background black -extent 1998x1080 -alpha off -depth 8 -type truecolor {}
Ce qui est étrange, c'est que ma variable $taille est bien interprétée mais pas la variable $aspect.
Voici comment j'initialise mes variables:
case $3 in
scope)format="S" && taille="2048x858";;
flat)format="F" && taille="1998x1080";;
esac
ratio=
mediainfo --Inform="Video;%DisplayAspectRatio%" ../"$1"
hauteur=
mediainfo --Inform="Video;%Height%" ../"$1"
hauteur=$hauteur!
largeur=$(echo "$hauteur*$ratio" | tr -d $'\r' | bc | cut -d"." -f1)
aspect="${largeur}x${hauteur}"!