no save
Assistance
Achat
News

Forum | programmation
[script/bash] Variable d'environnement
jisisv, le mer. 06 juil. 2005 à 06:23:26
Je ne sais pas ce que tu veux faire.
L'entité
$[$fichier] est une expression arithmétique (évalua tion du contenu de la variable fichier)
exemple

johand@horus:~$ fichier=packages-2005-05-10
johand@horus:~$ echo $[$fichier]
-2020
johand@horus:~$ fichier=packages-2005-05-10.txt
johand@horus:~$ echo $[$fichier]
bash: packages-2005-05-10.txt: syntax error in expression (error token is ".txt")

Extrait de man bash

Arithmetic expansion allows the evaluation of an arithmetic expression and the substitution of the result. The format for arithmetic expansion is:

$((expression))

The old format $[expression] is deprecated and will be removed in upcoming versions of bash.

Essaye de préciser le but de ta manip...
Johan

Précédentpanicc
juil. 05
panicc
juil. 05
Suivant
REPONSES
jisisv
juil. 05
panicc
juil. 05
Timon1102
juil. 05
panicc
juil. 05
asevere
juil. 05
jipicy
juil. 05
jipicy
juil. 05
panicc
juil. 05
jipicy
juil. 05
asevere
juil. 05
Version Web
Réalisé par RedShift
no save