Sponsored Content
Top Forums Shell Programming and Scripting Curl/http 503 error with bash script Post 303008627 by kieranfoley on Monday 4th of December 2017 10:10:54 AM
Old 12-04-2017
Hi Robin,

this is the output from the commands you asked me to run.

Code:
[root@seiemccli01 REST_API]# uname -a
Linux seiemccli01 2.6.39-400.215.10.el5uek #1 SMP Tue Sep 9 22:51:46 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@seiemccli01 REST_API]# ps -f
UID        PID  PPID  C STIME TTY          TIME CMD
root     14440 14435  0 10:05 pts/1    00:00:00 -bash
root     14590 14440  0 10:08 pts/1    00:00:00 ps -f
[root@seiemccli01 REST_API]# LINK=$(grep link $TEMP_DIR/test_xml.out)
[root@seiemccli01 REST_API]# echo "${LINK}"
   <link>http://seieadpa01:9004/dpa-api/report/result/57ba6675-1aa6-47cc-afdf-205b1d36d49c</link>
[root@seiemccli01 REST_API]#


In the script I strip out the leading and trailing <link>

Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script idea using cUrl -- possible?

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)
Discussion started by: SilversleevesX
3 Replies

2. UNIX for Advanced & Expert Users

Issue in Curl to send http POST request with attachment/multipart

Hi, I am using curl to hit a url using http in solaris 10 using commandline, I want to transfer an attachment(using multipart curl -F) also as a part of the request. If anyone has used kindly help me with the syntax. I am using below command: Code: /usr/local/bin/curl -v... (1 Reply)
Discussion started by: manishmaha
1 Replies

3. Shell Programming and Scripting

bash curl escape & in url

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)
Discussion started by: unclecameron
4 Replies

4. UNIX for Advanced & Expert Users

Syntax issue in curl for getting a file from http site

Hi All I am using curl in my client environment. We need to pull a file from the libraries site. All the files are having perticular URL which can be used to get the files. Only issue is, when we fire that command , it will take to authentication page 1st. once authentication is succed, it will... (1 Reply)
Discussion started by: prabirkumardhar
1 Replies

5. Linux

Apt-get update wont run and gives 503 service unavailable error

Hi, I am running on Ubuntu 12 (precise) 64 bit and came to know that i cannot install any packages using apt-get and aptitude. Linux test01 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux But the same /etc/apt/sources.list file is... (20 Replies)
Discussion started by: prash358
20 Replies

6. Shell Programming and Scripting

Sending awk variables into curl in a bash script

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)
Discussion started by: phaethon
6 Replies

7. Shell Programming and Scripting

awk script to find time difference between HTTP PUT and HTTP DELETE requests in access.log

Hi, I'm trying to write a script to determine the time gap between HTTP PUT and HTTP DELETE requests in the HTTP Servers access log. Normally client will do HTTP PUT to push content e.g. file_1.txt and 21 seconds later it will do HTTP DELETE, but sometimes the time varies causing some issues... (3 Replies)
Discussion started by: Juha
3 Replies

8. Shell Programming and Scripting

Using curl in bash script

Hello. I have pick up a script from internet to track errors from curl command. #!/bin/bash # URL_TO_TEST="http://www.xxxxxx.yyy" MY_VAR=curl_init("$URL_TO_TEST") ; curl_setopt($MY_VAR, CURLOPT_HEADER, 1); curl_setopt($MY_VAR, CURLOPT_RETURNTRANSFER, 1); curl_setopt($MY_VAR,... (2 Replies)
Discussion started by: jcdole
2 Replies

9. Shell Programming and Scripting

Access a complete flow with CURL + bash shell

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)
Discussion started by: radha254
5 Replies

10. Shell Programming and Scripting

Curl , download file with user:pass in bash script

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
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 02:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy