Thanks rbatte1. I tried setting the LINK variable as you suggested and I am still getting the same 503 http error. This is what my script looks like now.
This is the output from the script and as you can see I am getting the 503 Service Unavailable error.
Thanks for your reply Yoda. When I run the curl from the command line I never have an issue. I get the expected html output.
In the last line of my script I have an echo and if I run that from the command line it works. If I set the LINK variable on the command line and then un just as it looks in the script it work also.
That is if I do this from outside the script it works
This is the "head" of the output I should expect from the script.
Also, when I try to do the same as above using wget I am having the same issues. i.e it work outside the script but fails within it.
---------- Post updated at 10:32 AM ---------- Previous update was at 10:31 AM ----------
Sorry I never posted the output from running the curl -v which shows the 503 http error
---------- Post updated at 11:03 AM ---------- Previous update was at 10:32 AM ----------
This is the output when I use
within the script. Note that I have taken out the real usernameassword in the script in this post but the output shows that the username is actually admin.
---------- Post updated at 12:08 PM ---------- Previous update was at 11:03 AM ----------
It must have something to do with the curl calls made earlier in the script that break this. If I just have a small script with just these 2 entries it works.
The thing is that I need to generate the report first within the script using POST and then GET the report once I have generated it....
---------- Post updated at 12:23 PM ---------- Previous update was at 12:08 PM ----------
I decided to try to put a "
" before the last curl is executed and this has fixed the issue.
Thanks
This User Gave Thanks to kieranfoley For This Post:
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)
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)
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)
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)
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)
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)
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)
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,
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)
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)