标签:
[root@yrzl-cloud-aio ~]# sh b.sh
b.sh: line 12: warning: here-document at line 7 delimited by end-of-file (wanted `rui‘)
b.sh: line 13: syntax error: unexpected end of file
[root@yrzl-cloud-aio ~]#
[root@yrzl-cloud-aio ~]#
[root@yrzl-cloud-aio ~]# ls
anaconda-ks1.cfg CentOS-7-x86_64-DVD-1511.iso ifcfg-enp9s0 iso ll m.sh packages qinrui rr sou yr-cloud-picture-static-ip.iso
anaconda-ks.cfg i ins-packages k.sh mmmm n.sh pgs r rrrr wget-log
b.sh ifcfg-enp8s0 i.sh ks.sh mn package p.sh rpmbuild ruiy yr-cloud-picture.iso
[root@yrzl-cloud-aio ~]#
[root@yrzl-cloud-aio ~]#
[root@yrzl-cloud-aio ~]# cat b.sh
#!/bin/bash
i=0
for ifMacs in `ifconfig | grep ether | awk -F‘ ‘ ‘{print $2}‘ | head -n 2`
do
#echo $ifMacs
if [ -z /etc/udev/rules.d/70-persistent-ipoib.rules ];then
cat >> /etc/udev/rules.d/70-persistent-ipoib.rules <<rui
SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"${ifMacs}\", ATTR{dev_id}==\"0x0\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"eth{i}\"
ruiy
fi
i=$((i + 1))
done
[root@yrzl-cloud-aio ~]#
warning: here-document at line 7 delimited by end-of-file (wanted `rui')
标签:
原文地址:http://www.cnblogs.com/ruiy/p/5390384.html