Sponsored Content
Top Forums Shell Programming and Scripting CURL getting Error- couldn't connect to host Post 302782667 by zigizag on Tuesday 19th of March 2013 09:28:03 AM
Old 03-19-2013
CURL getting Error- couldn't connect to host

Hi

i am trying to open HTTP by curl command.

i am tryng to do that from command or script BASH.
also iptables is off

it doesnt work i am getting an error:

curl: (7) coudn't connect to host

the scipt is:
Code:
#! /bin/bash

curl http://www.cnn.com

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sendmail : connect local host (brocken)

hi there I've got a strange problem with a webserver box (suse linux 7.2). My MTA is sendmail, and when I tried manually send a mail. Sendmail -v "user@something" < /etc/hosts The Server tried "simon@localhost... Connecting to local..." but nothing happend and the system hold on. This... (3 Replies)
Discussion started by: mrsaint
3 Replies

2. UNIX for Dummies Questions & Answers

Got connected with Modem but cannot dial Telephone no. to connect to host

Hello There, I configure my Modem as follow. Step1. # admintool & Then from Browse --> Serial Port i select tta port and Edit --> Modify From that i select Template : Modem:Dial Out Baud Rate: 9600 Ok Step 2 # tip /dev/cua/a connected (1 Reply)
Discussion started by: abidmalik
1 Replies

3. Linux

ssh: connect to host traviata port 22: No buffer space available

What does that mean? traviata being my distant host? What am i to do? (0 Replies)
Discussion started by: penguin-friend
0 Replies

4. Shell Programming and Scripting

How can my unix shell script automatically connect to remote host?

How can my unix shell script automatically connect to remote host? Assume that there is a remote host called "rhost". When I connect to that host i give the command "telnet rhost". It then asks me for my id and password. Once i give it connects there. I want to automate these steps. I want... (8 Replies)
Discussion started by: digdarshan
8 Replies

5. Linux

Couldn't connect to Internet

I have installed fedora core 7 in my system. When I try to activate the network card it says "Could not determine IP address for eth0...failed". Please give me suggestions? (2 Replies)
Discussion started by: mvictorvijayan
2 Replies

6. Shell Programming and Scripting

Connect to Oracle in Windows XP from Linux HOST

Hi everyone, I have oracle 9i installed in Windows XP and i have ubuntu in VM WARE. I would like to know how to connect to Oracle in windows xp from Linux through shel scripting...... (3 Replies)
Discussion started by: Zimbu
3 Replies

7. UNIX and Linux Applications

Unable to connect to a website using Curl

Hello, I am using Curl command to make a function call to a web service. The issue I am facing right now is: curl h**p://www.google.com with the above command, I get a XML file as a response. Also when i execute : wget h**p://www.google.com Replace ** : tt I can see status as... (1 Reply)
Discussion started by: amitshete
1 Replies

8. UNIX Desktop Questions & Answers

Listening on localhost - cannot connect to host using port 3010

Hi Guys, my issue is - I have people connecting to my hosts from the outside world (for POC testing). There application listens on a port 3010 which is bound to the localhost. Using netstat -an | grep LISTEN it is the only port that is bound - ie: ftp, ssh etc listen on all interfaces. I need... (1 Reply)
Discussion started by: brian112
1 Replies

9. Shell Programming and Scripting

Connect to target host from Source host.

Hi All, Need to connect to target host and execute a command and connect back to source host to continue with next set of command execution. Is there a utility/command using which we can connect to target host ? Please suggest. Note: Netezza database is instaled on Linux server. ... (4 Replies)
Discussion started by: Nagaraja Akkiva
4 Replies

10. UNIX for Beginners Questions & Answers

How to connect to a DB installed on another host using shell script?

Hi Experts There are two hosts say A and B. On host B, Oracle DB is installed and running. I am trying to check if the DB on host B is up and running fine from a script on host A. Is this possible. I tried using commands like sql plus but those doesn't seem to help. Could you please guide. (8 Replies)
Discussion started by: harishshankar
8 Replies
CURLOPT_USERAGENT(3)					     curl_easy_setopt options					      CURLOPT_USERAGENT(3)

NAME
CURLOPT_USERAGENT - set HTTP user-agent header SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_USERAGENT, char *ua); DESCRIPTION
Pass a pointer to a zero terminated string as parameter. It will be used to set the User-Agent: header in the HTTP request sent to the remote server. This can be used to fool servers or scripts. You can also set any custom header with CURLOPT_HTTPHEADER(3). The application does not have to keep the string around after setting this option. DEFAULT
NULL, no User-Agent: header is used by default. PROTOCOLS
HTTP, HTTPS EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); curl_easy_setopt(curl, CURLOPT_USERAGENT, "Dark Secret Ninja/1.0"); curl_easy_perform(curl); } AVAILABILITY
As long as HTTP is supported RETURN VALUE
Returns CURLE_OK if HTTP is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. SEE ALSO
CURLOPT_REFERER(3), CURLOPT_HTTPHEADER(3), libcurl 7.54.0 December 21, 2016 CURLOPT_USERAGENT(3)
All times are GMT -4. The time now is 10:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy