退
shell里for循环可以嵌套if吗
问题描述
shell里for循环可以嵌套if吗,麻烦给回复
- 精选答案
-
我的回答:可以嵌套。
shell里面for循环是可以嵌套if条件语句的。举例:for i in `cat /etc/ansible/iplist`;doif echo $i |grep \"192\"; thenpass='Abc@123'echo \"$i ansible_ssh_port=22 ansible_ssh_user=root ansible_user_pass=\\\"$pass\\p\"\" >>/etc/ansible/hostselseecho $i >>/etc/ansible/hostsfidone
本文标题:shell里for循环可以嵌套if吗
本文链接:https://www.bjdnbx.com/know/380122.html
转载请注明出处:来源于广知网,谢谢配合!
最新发布