Retourner au contenu associé (entrée de forum : shell : pipe et variable locale)
Posté par pi6Lohe le 16 novembre 2009 à 00:28. En réponse au message shell : pipe et variable locale. Évalué à 1.
#!/bin/dash VAR=0; while read line do var=$(($var + 1)) done <<EOF $(ls) EOF echo $var
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: J'oubliais...
Posté par pi6Lohe . En réponse au message shell : pipe et variable locale. Évalué à 1.
#!/bin/dash
VAR=0;
while read line
do
var=$(($var + 1))
done <<EOF
$(ls)
EOF
echo $var