ChinaUnix.net
相关文章推荐:

curl exec 不支持

想实现的功能是在C中调用df -h | grep /dev/sda8 > diskinfo 来获得磁盘的存储的信息 if(fork()==0){ if(execl("/bin/df","df","-h",NULL)<0){ //也就是调用df -h 命令,但是 | grep /dev/sda8 > diskinfo 替换掉NULL后execl就执行出错了,打印error。 printf("error\n"); return -1; } exit(0); } 请教一下调用exec系列函数如何完成这个功能:...

by rocky1972 - C/C++ - 2007-12-26 08:37:33 阅读(1426) 回复(3)

相关讨论

用getRuneTime().exec("rm -fr *.txt");不能删掉那些txt文件 但是用getRuneTime().exec("rm -fr aaa.txt");确可以成功。难道是它不支持wildcard?

by icesummit - Java - 2006-04-28 22:41:56 阅读(2204) 回复(5)

a.php curl_init(); curl_setopt ($ch, curlOPT_URL,url); $xyz = curl_exec ($ch); curl_close ($ch); echo $xyz; ?> #php a.php 为什么有的url得不到网页的内容,只能输出$xyz的值1,有的url就可以输出网页的内容并且输出$xyz的值1

by xiner10 - PHP - 2008-06-10 11:30:29 阅读(2214) 回复(3)

Usage: curl [options...] Options: (H) means HTTP/HTTPS only, (F) means FTP only -a/--append Append to target file when uploading (F) -A/--user-agent User-Agent to send to server (H) --anyauth Pick "any" authentication method (H) -b/--cookie Cookie string or file to read cookies from (H) --basic Use HTTP Basic Authentication (H) -B/--use-ascii Use ASCII/text ...

by ilovit - Linux文档专区 - 2009-03-19 10:01:24 阅读(921) 回复(0)

今天看到curl的用法,不错记录一下。 原文地址: http://www.linuxidc.com/Linux/2008-01/10891p2.htm Linux curl使用简单介绍 curl是Linux下一个很强大的http命令行工具,其功能十分强大。 1) 二话不说,先从这里开始吧! $ curl http://www.linuxidc.com 回车之后,www.linuxidc.com 的html就稀里哗啦地显示在屏幕上了 ~ 2) 嗯,要想把读过来页面存下来,是不是要这样呢? $ curl http://www.linuxidc.com > page.html 当然可...

by xinyv - Linux文档专区 - 2008-11-17 21:35:16 阅读(1065) 回复(0)

linux下写shell脚本程序 经常会遇到需要post提交东西的时候 这时候用curl是非常方便的 我举一个例子: curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" \ -e "http://www.xxx.com/poll.shtml" \ -d "2880[]=105&pid=2880&p=最佳&count=1&receipt=1&poll=投票" \ http://survey.xxx.com/poll/poll.php 这里 -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" 的意思就是申明自己用的是windows2000下的ie6的...

by yannankai - Linux文档专区 - 2006-04-30 15:16:53 阅读(719) 回复(0)

[code]#!/bin/sh hot_line=4006019977 cno_num_sub=2000 ccic_ip=xxx.xx.xxx.xx record_num_sub=1 curl -A "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" -o output_AgentLogin.htm -D cookie_AgentLogin.txt "http://xxx.xx.xxx.xx/system%21getLoginSecurityCodeImage.action" curl -A "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" -b cookie_AgentLogin.txt "http://xxx.xx.xxx....

by haofang666777 - Shell - 2013-11-08 19:45:36 阅读(5206) 回复(9)

本帖最后由 luwenju 于 2012-05-06 10:35 编辑 有这样一个问题: 比如用浏览器访问一个图片连接 http://192.168.1.100/test.jpg 时可正常显示图片,但是使用curl -I http://192.168.1.100/test.jpg 时获取的状态码是404,而不是200,什么问题?

by luwenju - Linux系统管理 - 2012-05-07 11:17:15 阅读(1144) 回复(1)

curl post数据到一个网站 但是 有像这样的

by lkk2003rty - Shell - 2010-11-12 21:00:54 阅读(2014) 回复(6)

想熟悉一下curl,怎么搞也搞不明白,有没有人帮下忙,把下面这个函数改成用curl实现。 function translate($content){ $argv = array('text'=>$content, 'hl'=>'zh-CN', 'langpair'=>'zh-CN|en', 'ie'=>'UTF-8'); $params = http_build_query($argv); $length = strlen($params); $fp = fsockopen("www.google.com",80,$errno,$errstr,10) or exit($errstr.":".$errno); $header = "POST /translate...

by SeriousCool - PHP - 2009-11-05 23:01:10 阅读(1855) 回复(3)

功能强大的curl 1) 通过curl直接访问sina网站curl http://www.sina.com.cn 2) 你也可以把sina保存期来curl http://www.sina.com > sina 或 curl -o sina http://www.sina.com.cn 3) 同时可以通过代理来访问网页curl -x 10.54.38.18:8080 -o sina.html http://www.sina.com.cn 4) 可以把cookies存放到一个文件里curl -x 10.54.38.18:8080 -o sina.html -D cookie002.txt http://www.sina.com.cn 5) 下一次访问的时候,如何...

by xinshuow - Linux文档专区 - 2009-03-27 15:16:22 阅读(948) 回复(0)