<![CDATA[Forum Ubuntu-fr.org / Caractère spéciaux dans une variable]]> http://forum.ubuntu-fr.org/viewtopic.php?id=1194491 Sat, 09 Feb 2013 18:54:50 +0000 FluxBB <![CDATA[Réponse à : Caractère spéciaux dans une variable]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=12525831#p12525831 lis cette page, c'est bien expliqué (les exemples surtout) : http://abs.traduc.org/abs-fr/ch04.html

]]>
Sat, 09 Feb 2013 18:54:50 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=12525831#p12525831
<![CDATA[Réponse à : Caractère spéciaux dans une variable]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=12525741#p12525741 Merci pour ta réponse, mon problème est résolu.

Par contre comment expliquer ce comportement :

var=`ping -c1 google.fr`
echo "$var"

Avec les doubles quotes (echo "$var"), le echo concerve les sauts de lignes.
Sans les doubles quotes (echo $var), le echo ne concerve les sauts de lignes.

Sans doubles quotes le résultat est sur une ligne :

PING google.fr (173.194.45.88) 56(84) bytes of data. 64 bytes from par03s13-in-f24.1e100.net (173.194.45.88): icmp_req=1 ttl=52 time=37.1 ms --- google.fr ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 37.194/37.194/37.194/0.000 ms

Merci pour cette explication !

]]>
Sat, 09 Feb 2013 18:46:39 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=12525741#p12525741
<![CDATA[Réponse à : Caractère spéciaux dans une variable]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=12525201#p12525201 Bonjour,

echo "$var"
]]>
Sat, 09 Feb 2013 18:04:18 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=12525201#p12525201
<![CDATA[Caractère spéciaux dans une variable]]> http://forum.ubuntu-fr.org/viewtopic.php?pid=12525171#p12525171 Bonjour à tous.

Simple question, comment éviter l’interprétation des caractères spéciaux stocké dans une variable ?

Exemple :

var='kjkjkjkj * *'
echo $var

qui donne :

kjkjkjkj file1 file2 file3 ...

Merci beaucoup pour vos réponses.

]]>
Sat, 09 Feb 2013 18:02:52 +0000 http://forum.ubuntu-fr.org/viewtopic.php?pid=12525171#p12525171