Retourner au contenu associé (entrée de forum : [RÉSOLU] Bash utiliser variable dans une commande du style result=$(commande | grep $variable))
Posté par totof2000 le 26 mai 2017 à 14:15. En réponse au message [RÉSOLU] Bash utiliser variable dans une commande du style result=$(commande | grep $variable). Évalué à 3.
C'est pas forcément mauvais, mais il y a des cas ou ça ne marche pas.
Exemple :
$touch abc def ghi $ls -l total 0 -rw-rw-r-- 1 xxxx xxxx 0 May 26 14:14 abc -rw-rw-r-- 1 xxxx xxxx 0 May 26 14:14 def -rw-rw-r-- 1 xxxx xxxx 0 May 26 14:14 ghi $"ls -l" -bash: ls -l: command not found
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: utiliser eval ?
Posté par totof2000 . En réponse au message [RÉSOLU] Bash utiliser variable dans une commande du style result=$(commande | grep $variable). Évalué à 3.
C'est pas forcément mauvais, mais il y a des cas ou ça ne marche pas.
Exemple :