Sponsored Content
Top Forums Shell Programming and Scripting how to proceed when curl is finished Post 302689595 by Chubler_XL on Tuesday 21st of August 2012 06:16:26 PM
Old 08-21-2012
So is it just $datastring that contains $variables that you need to expand?

Edit: Yes, the expanded $url variable will need to be quoted to ensure the shell dosn't intrepret anything within it. Preferablly with single quotes.

Try:
Code:
string=$(echo "curl -d "'"'$datastring'"'" -b cookie.txt -c cookie.txt -L "\'$url\')

This User Gave Thanks to Chubler_XL For This Post:
 

8 More Discussions You Might Find Interesting

1. Programming

I am porting Dll from NT to Unix, how should I proceed

I am porting Dll from Windows NT to Unix, Could any body pls guide me how should I proceed?? (3 Replies)
Discussion started by: Vipin
3 Replies

2. UNIX for Dummies Questions & Answers

How can i proceed on this (datecheck)

Hi, I want to bundle if statements The script which i created is if ]; then if ]; then now=`TZ=CST+24 date +%Y-%m-%d` nows=`TZ=CST+24 date +%Y-%m-%d` ; else ]; then now=`TZ=CST+48 date +%Y-%m-%d` nows=`TZ=CST+48 date +%Y-%m-%d` ; fi now=`TZ=CST+24 date +%Y-%m-%d` nows=`date... (2 Replies)
Discussion started by: gopskrish
2 Replies

3. Shell Programming and Scripting

Need help for automating a task. How to proceed ?.

Dear friends, I am trying to prepare a shell script which do the following task. Being a beginner in scripting I need a bit of help from you all for shell script which does the following job. 1.Check for existence of a file in a shared directory (at some remote location ) once in a day ... (1 Reply)
Discussion started by: aarora_98
1 Replies

4. UNIX for Dummies Questions & Answers

Using exit status of GREP to proceed

Hi I have a script that carries out a "grep" command, and displays the output on screen. What I need to do is utilise the exit status of this grep, so that, for example, if it returns no entries, it asks the user if they want to set up a new user, and if the grep returns an entry, it states... (1 Reply)
Discussion started by: Great Uncle Kip
1 Replies

5. Solaris

Zlogin -C with out user Interaction how to proceed?

Hi Guys, I have one requirement like if we run install.sh file it should have to create a zone and install oracle in that zone with out any user interaction. So the complete code should be automated. Almost 90% of the code I completed but i am having some doubts 1) After the zone creation... (1 Reply)
Discussion started by: vijaysachin
1 Replies

6. Web Development

Request to check:PHP help hw to proceed

Hi I am new to PHP. I have to changed a website design adn add certain features and lnks which shuld direct it towards other website. Can any body help me how to proceed. I have some already made templates to do this. I am conpletely new.. So, I have to first install Php from... (0 Replies)
Discussion started by: manigrover
0 Replies

7. Shell Programming and Scripting

How to timeout and proceed in perl?

I'm writing a small socket program (UDP) to communicate between two servers. Problem is, I dont know how to implement time out hence my script keeps on waiting for the peer response. #!/usr/bin/bash use IO::Socket::INET; $|=1; $socket=new IO::Socket::INET->new(LocalPort=>5001, ... (2 Replies)
Discussion started by: Arun_Linux
2 Replies

8. Shell Programming and Scripting

Script to Proceed to the Next IP if the current IP hangs

Hi there, Say I have a list of IPs, I am running scripts on them. If the process hang. I want to continue with the rest of the IPs. 10.11.1.1 10.11.1.2 10.11.1.3 10.11.1.4 10.11.1.5 10.11.1.6 <-- Process Hangs here 10.11.1.7 10.11.1.8 10.11.1.9 10.11.1.10 10.11.1.11 10.11.1.12 ... (11 Replies)
Discussion started by: alvinoo
11 Replies
CURLINFO_RESPONSE_CODE(3)				     curl_easy_getinfo options					 CURLINFO_RESPONSE_CODE(3)

NAME
CURLINFO_RESPONSE_CODE - get the last response code SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RESPONSE_CODE, long *codep); DESCRIPTION
Pass a pointer to a long to receive the last received HTTP, FTP or SMTP response code. This option was previously known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. The stored value will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with CURLINFO_HTTP_CONNECTCODE(3) and not this. Support for SMTP responses added in 7.25.0. PROTOCOLS
HTTP, FTP and SMTP EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { CURLcode res; curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); res = curl_easy_perform(curl); if(res == CURLE_OK) { long response_code; curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); } curl_easy_cleanup(curl); } AVAILABILITY
Added in 7.10.8. CURLINFO_HTTP_CODE was added in 7.4.1. RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
curl_easy_getinfo(3), curl_easy_setopt(3), CURLINFO_HTTP_CONNECTCODE(3), libcurl 7.54.0 February 03, 2016 CURLINFO_RESPONSE_CODE(3)
All times are GMT -4. The time now is 06:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy