需要用ctrl+a切换屏幕输出,等待特定信息出现,expect脚本怎么写
时间:2011-03-01
来源:互联网
#!/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
作者: 火雪心 发布时间: 2011-03-01
文件名怎么是囗囗囗囗囗囗.txt
字符编码没问题吧
字符编码没问题吧
作者: gamesun 发布时间: 2011-03-01
发到论坛上就这样
其实是yuming.txt
发到论坛上就变了
其实是yuming.txt
发到论坛上就变了
作者: 火雪心 发布时间: 2011-03-01
^M
这是常见的格式错误。你是在windows下写的这个脚本吧。
安装tofrodos或dos2unix转一下格式
这是常见的格式错误。你是在windows下写的这个脚本吧。
安装tofrodos或dos2unix转一下格式
作者: trigger 发布时间: 2011-03-01
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28