Ps: ==很多情况会出现安装失败的问题,其实是因为下载的站点在国外,如果有代理会好点,但是也有可能下载站点拥塞导致下载失败,不要着急慢慢下载就行了。大概回报错,类似于这样== curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
if 判断条件 1 ; then 条件为真的分支代码 elif 判断条件 2 ; then 条件为真的分支代码 elif 判断条件 3 ; then 条件为真的分支代码 else 以上条件都为假的分支代码 fi
Ps:这是一个测试例子
1 2 3 4 5 6 7 8 9 10
根据命令的退出状态来执行命令 if ping -c1 -W2 station1 &> /dev/null; then echo 'Station1 is UP' elif grep "station1" ~/maintenance.txt &> /dev/null then echo 'Station1 is undergoing maintenance‘ else echo 'Station1 is unexpectedly DOWN!' exit 1 fi
case语句
条件判断和函数结合可以Linux系统脚本经常出现
case 变量引用 in
PAT1)
分支1
;;
PAT2)
分支2
;;
...
*)
默认分支
;;
esac
PS:这个是具体的例子
1 2 3 4 5 6
#! /bin/bash case $1 in 1) echo "你输入了1";; 2) echo "你输入了2";; *) echo "你输入了其他";; esac
eg: mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; ERROR 1819 (HY000): Your password does not satisfy the current policy requiremen
validate_password_policy 密码强度检查等级,0/LOW、1/MEDIUM、2/STRONG。有以下取值: Policy Tests Performed 0 or LOW Length 1 or MEDIUM Length; numeric, lowercase/uppercase, and special characters 2 or STRONG Length; numeric, lowercase/uppercase, and special characters; dictionary file 默认是1,即MEDIUM,所以刚开始设置的密码必须符合长度,且必须含有数字,小写或大写字母,特殊字符。