[root@fyc14 nginx1]# cat <<EOF > /etc/yum.repos.d/nginx.repo
> [nginx]
> name=nginx repo
> baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
> gpgcheck=0
> enabled=1
> EOF
[root@fyc14 nginx1]# cat /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE//
gpgcheck=0
enabled=1
现在改为脚本xx.sh
#/bin/bash
#power by fyc119
cat <<EOF >> /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1
EOF