一个简单脚本,但不知道为什么老出错,大家帮忙看下
发表于 : 2011-03-01 9:02
#!/bin/bash
cat ./囗囗囗囗囗囗.txt|while read line;do
echo $line
cat >/etc/nginx/alternatives/${line}.conf <<eof
server {
server_name $line;
root /var/www/$line;
include /etc/nginx/fastcgi_php;
location / {
index index.php;
if (!-e \$request_filename) {
rewrite ^(.*)\$ /index.php last;
}
}
}
eof
done
目的:
读取yuming.txt中的文本 一行一个的那种
然后在路径etc/nginx/alternatives/中创建相应的文件
不知道为什么不能执行,提示
/bin/bash^M: bad interpreter: No such file or directory
cat ./囗囗囗囗囗囗.txt|while read line;do
echo $line
cat >/etc/nginx/alternatives/${line}.conf <<eof
server {
server_name $line;
root /var/www/$line;
include /etc/nginx/fastcgi_php;
location / {
index index.php;
if (!-e \$request_filename) {
rewrite ^(.*)\$ /index.php last;
}
}
}
eof
done
目的:
读取yuming.txt中的文本 一行一个的那种
然后在路径etc/nginx/alternatives/中创建相应的文件
不知道为什么不能执行,提示
/bin/bash^M: bad interpreter: No such file or directory