他のif条件を追加

他のif条件を追加

次のスクリプトは正常に動作します。

for i in `cat /app/scripts/symantec_scripts/list`
do ssh root@$i "uname -n
if [ -s /app/Symantec/virusdefs/definfo.dat ]; then
  cat /app/Symantec/virusdefs/definfo.dat
else
  cat /opt/Symantec/virusdefs/definfo.dat
fi
echo `service rtvscand status`
echo ....................................................................." ; done | tee /tmp/symantec_info.`date +"%m%d%y"`

新しいサーバーがいくつかあり、ファイルの場所は/usr/symantec/virusdefs/definfo.dat

上記の行をスクリプトにどのように追加できますか?助けてくれてありがとう。

ベストアンサー1

: ...
elif [ -s 'the other file' ]; then
   : ...
fi

構文は bash(1) に文書化されています。

おすすめ記事