+options=( server_ip my_name my_email )
+for option in ${options[@]} +do
- export $option=$(grep "^$option:" /etc/compass-ci/setup.yaml |awk -F ": " '{print $2}')
export is a disposable config for variable, it take effect just for the login this time. for the next login, it will in failure. if you want to use it all the time, add 'export my_email|my_name|server_ip' to user's default profile. and source it for current login.
just need it take effect for the login this time.
for the line above, use awk if enough, no need 'grep--awk', like: export $option=$(awk -F ": " '/^'$option'/ {print $2}' /etc/compass-ci/setup.yaml)
good
Thanks, Yinsi
Thanks, Luan Shengde
+done
2.23.0