今回は、シェルスクリプトのでforの使い方を説明します。
手順
1.CentOS81号機にログイン
2.Chronyのインストール
3.セキュリティ設定
4.動作確認
1.CentOS81号機にログイン
TeraTermで、CentOS1号機にrootでログインします。
2.forの使い方
# シェルスクリプトの作成
[root@CE08PRDD104 tmp]# vi for.sh
!/bin/bash
for animal in dog cat bird
do
echo $animal
done
# シェルスクリプトに実行権を付与する
[root@CE08PRDD104 tmp]# chmod +x for.sh
# シェルスクリプトの実行
[root@CE08PRDD104 tmp]# . for.sh
dog
cat
bird