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