The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
piping a url to wget or curl? ropers Shell Programming and Scripting 5 03-21-2009 12:35 AM
help with curl using ssl to ftp file gandolf989 Shell Programming and Scripting 0 07-10-2008 12:34 PM
use of curl jayawantsandeep Shell Programming and Scripting 0 06-18-2008 11:53 AM
use of curl jayawantsandeep AIX 0 06-16-2008 05:08 AM
curl Euler04 Shell Programming and Scripting 6 07-27-2005 04:16 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-04-2008
phpfreak phpfreak is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 50
needs some curl help

Could someone explain to me why my curl string is breaking...

WORKING: https://fqdn.net/


Code:
$ curl -k -u user:pass -e https://anexternalpage.net/ -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4" -v https://anexternalpage.net/
* About to connect() to anexternalpage.net port 443 (#0)
*   Trying 68.180.206.184... connected
* Connected to anexternalpage.net (68.180.206.184) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: /usr/local/share/curl/curl-ca-bundle.crt
  CApath: none
* SSLv2, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using DHE-RSA-AES56-SHA
* Server certificate:
*        subject: /C=US/ST=Colorado/L=Englewood/O=Gator Inc./CN=anexternalpage.net
*        start date: 2008-10-14 00:24:05 GMT
*        expire date: 2009-11-14 01:24:05 GMT
*        common name: anexternalpage.net (matched)
*        issuer: /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
* SSL certificate verify ok.
* Server auth using Basic with user 'username'
> GET / HTTP/1.1
> Authorization: Basic amV2ZWlsbyZDphZXJpbzkwMA==
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
> Host: anexternalpage.net
> Accept: */*
> Referer: https://anexternalpage.net/
> 
< HTTP/1.1 200 OK
< Date: Thu, 04 Dec 2008 04:12:39 GMT
< Server: Apache/2.2.8 (FreeBSD) mod_ssl/2.2.8 OpenSSL/0.9.7e-p1 DAV/2 PHP/5.2.6 with Suhosin-Patch mod_auth_kerb/5.3
< Last-Modified: Fri, 19 Sep 2008 17:55:59 GMT
< ETag: "b358b-4cd-4574369f609c0"
< Accept-Ranges: bytes
< Content-Length: 1229
< Content-Type: text/html
< 
<html>
<head>
--chopped for brevity and my own job secuirty.. hehe.
</body>
</html>

* Connection #0 to host anexternalpage.net left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
$


DOESN'T WORK: https://fqdn.net/cgi-bin/and?some&really=long&string..



Code:
$ curl -k -u user:pass -e https://anexternalpage.net/nag/cgi-bin/status.cgi?host=all&servicestatustypes=28&serviceprops=10&hostprops=10&sorttype=2&sortoption=3 -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4" -v https://anexternalpage.net/nag/cgi-bin/status.cgi?host=all&servicestatustypes=28&serviceprops=10&hostprops=10&sorttype=2&sortoption=3              
[1] 40941
[2] 40942
[3] 40943
[4] 40944
[5] 40945
[6] 40946
[7] 40947
[8] 40948
[9] 40949
[10] 40950
$ -bash: -A: command not found
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information


^C


Code:
[1]   Exit 2                  curl -k -u user:pass -e https://anexternalpage.net/nag/cgi-bin/status.cgi?host=all
[2]   Done                    servicestatustypes=28
[3]   Done                    serviceprops=10
[4]   Done                    hostprops=10
[5]   Done                    sorttype=2
[6]   Exit 127                sortoption=3 -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4" -v https://anexternalpage.net/nag/cgi-bin/status.cgi?host=all
[7]   Done                    servicestatustypes=28
[8]   Done                    serviceprops=10
[9]-  Done                    hostprops=10
[10]+  Done                    sorttype=2
$


Why isn't it looking at the command as one vs. multiple commands and more importantly, how can I work around it? Could the request to cgi-bin have anything to do with it?

I'm working with..
FreeBSD 6.3-RELEASE #2
Curl 7.18.0


Also, here is the FF interaction if it helps any. FF doesn't complain


Code:
https://anexternalpage.net/nag/cgi-bin/status.cgi?host=all&servicestatustypes=28&serviceprops=10&hostprops=10&sorttype=2&sortoption=3

GET /nag/cgi-bin/status.cgi?host=all&servicestatustypes=28&serviceprops=10&hostprops=10&sorttype=2&sortoption=3 HTTP/1.1
Host: anexternalpage.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Authorization: Basic amV2ZWlsbGFyZhZXJpbzkwMA==

HTTP/1.x 200 OK
Date: Thu, 04 Dec 2008 04:38:16 GMT
Server: Apache/2.2.8 (FreeBSD) mod_ssl/2.2.8 OpenSSL/0.9.7e-p1 DAV/2 PHP/5.2.6 with Suhosin-Patch mod_auth_kerb/5.3
Cache-Control: no-store
Pragma: no-cache
refresh: 90
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Last-Modified: Thu, 04 Dec 2008 04:38:16 GMT
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
----------------------------------------------------------

Please, any info would be greatly appreciated.
  #2 (permalink)  
Old 12-04-2008
drl's Avatar
drl drl is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2007
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 717
Hi.

Use quotes around the URL. I usually use wget, and I find that I often need to do that with many URLs. Otherwise the shell will attempt to do something with special characters, e.g. "?", and break the string at whitespace, etc. ... cheers, drl
Closed Thread

Bookmarks

Tags
shell script, shell scripting, unix scripting, unix scripting basics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0