xdjm,进来瞅瞅啦……
时间:2011-11-23
来源:互联网
我想用kshell判断一个http链接到底是通不通 我该如何判断啊?有想法说下想法,没想法的给点鼓励也行……
作者: jinjong 发布时间: 2011-11-23
Python code
python来
你看上面报错了就是不行,因为我的虚拟机没连internet网~~
[root@RHEL6A scripts]# vim py2.py [root@RHEL6A scripts]# chmod u+x py2.py [root@RHEL6A scripts]# ./py2.py <urlopen error [Errno -2] Name or service not known> [root@RHEL6A scripts]# more py2.py #!/usr/bin/env python #coding:utf-8 import urllib2 def main(): try: url='http://www.163.com' url='http://www.163.com' return1=urllib2.urlopen(url) except Exception,ex: print ex if __name__=='__main__': main()
python来

你看上面报错了就是不行,因为我的虚拟机没连internet网~~
作者: askandstudy 发布时间: 2011-11-23
引用 1 楼 askandstudy 的回复:
Python code
[root@RHEL6A scripts]# vim py2.py
[root@RHEL6A scripts]# chmod u+x py2.py
[root@RHEL6A scripts]# ./py2.py
<urlopen error [Errno -2] Name or service not known>
[root@RHEL6A scripts……
Python code
[root@RHEL6A scripts]# vim py2.py
[root@RHEL6A scripts]# chmod u+x py2.py
[root@RHEL6A scripts]# ./py2.py
<urlopen error [Errno -2] Name or service not known>
[root@RHEL6A scripts……
我想用Kshell,这个我用不起来额 ,写在脚本里的。
不过谢谢你操心啊……我一定会结贴的 不会忘记xd你的……
作者: jinjong 发布时间: 2011-11-23
Assembly code
你试试看这个好不好用
# ./ks1.sh website is down. Trigger the email # more ks1.sh #!/bin/ksh wget -q -O /dev/null -S http://www.163.com if [ $? = 0 ] then echo "website is up" else echo "website is down. Trigger the email" fi
你试试看这个好不好用
作者: askandstudy 发布时间: 2011-11-23
Assembly code
#!/bin/ksh wget -q -O /dev/null -S http://www.163.com if [ $? = 0 ] then echo "website is up" else echo "website is down. Trigger the email" fi
作者: askandstudy 发布时间: 2011-11-23
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28