I have an alias already in my .bash_profile to download files using cUrl's -o (output to file, user provides the file name) option. I find I'm using it quite a bit, so I wanted to write a script to run "curl -o", taking the necessary inputs - file name and URL from which to download - and then... (3 Replies)
Hello everyone
I'm currently using a script to upload files (different file names, but same date) to an ftp server (see below)
#!/bin/sh
# Set the variables
HOST=<host>
USER=<user>
PASSWD=<password>
ftp -i -n $HOST <<END_SCRIPT
user ${USER} ${PASSWD}
mput... (0 Replies)
I'm running a curl command in bash, but the & in the middle causes the second half of the line to run in the background, here's what I'm trying to do:
lat="37.451"
lon="-122.18"
url="http://ws.geonames.org/findNearestAddress?lat=$lat&lng=$lon"
curl -s "$url"
I tried escaping the & with \&,... (4 Replies)
Hi all
so I'm new to scripting but I am making a script that is a url shortener. It will take a url off the command line and spit back the shortened version using bit.ly's api
this is what I have so far
if
then
echo "You must supply a URL."
exit 1
fi
read url... (3 Replies)
Hello experts!
I have a file1 with the following format (yr,day, month, hour,minute):
201201132435
201202141210
201304132030
201410100110
...
What i want to do is to assign variables and then use them in the curl command to download the text of each event from a web page.
What I have... (6 Replies)
I am trying to use REST API and curl in a bash script to generate a http report. The curl command at the end of the script should generate a html file but instead I get an error "HTTP/1.1 503 Service Unavailable".
This is the script
#!/bin/bash
export... (7 Replies)
Hello Experts ,
I have an use case which needed your help . I have been using google for 2 days buy couldn`t succed , i believe i can get the help here.
Here is my use case to run on bash shell
1. Access an URL -- in script , it will be mentioned as inputURL
2. Once i accessed the URL... (1 Reply)
Hello Experts ,
I have an use case which needed your help . I have been using google for 2 days buy couldn`t succed , i believe i can get the help here.
Here is my use case to run on bash shell
1. Access an URL -- in script , it will be mentioned as inputURL
2. Once i accessed the URL... (5 Replies)
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)
Hello,
My question is about curl command. (ubuntu14.04)
In terminal, I am able to download my mainfile with:
curl -u user1:pass1 http://11.22.33.44/*******
When I convert it into bash script like this:
#!/bin/bash
cd /root/scripts
computer_ip=11.22.33.44
curl -u $1:$2... (8 Replies)
Discussion started by: baris35
8 Replies
LEARN ABOUT MOJAVE
curlopt_useragent
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)