Sponsored Content
Top Forums Shell Programming and Scripting Access a complete flow with CURL + bash shell Post 303019273 by radha254 on Tuesday 26th of June 2018 06:41:17 AM
Old 06-26-2018
Quote:
Originally Posted by apmcd47
java? I thought you were using bash.

Curl has an option, -c in its short form, --cookie-jar in its long form, to save cookies:
Code:
curl --cookie-jar my-cookies http://some.url.com

Can you not use that to save the cookies, and read the file for the cookies you are interested in?

The curl man page can be found here.

Andrew
I meant shell, by seeing jar thought your were referring to Java. Never mind..

I Gonna try this and keep you posted with result. But with your explanation seems it will work..

Do you have any suggestion on the url error I am getting when adding the url into a text file and using with - url option?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

BASH complete-filename & menu-complete together

Hi, Does anyone know how to make BASH provide a list of possible completions on the first tab, and then start cycling through the possibilites on the next tab? Right now this is what I have in my .bashrc: bind "set show-all-if-ambiguous on" bind \\C-o:menu-complete This allows... (0 Replies)
Discussion started by: Mithu
0 Replies

2. 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

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. Shell Programming and Scripting

Using Curl to Access PayPal

can anyone please help me with this? i know paypal is a secure site, so a code like the below would be needed. but that's where i get stuck. curl -s -K https://www.paypal.com I need to be able to curl to paypal and download a list of latest purchases. i know there HAS to be a way to do... (0 Replies)
Discussion started by: SkySmart
0 Replies

5. Shell Programming and Scripting

Help with make sure shell script execute instruction in flow

Hi, I want to write a shell script to make sure all the instruction is executive in flow. eg. I want my shell script to run finish this two progress first: ./program input_file_1.txt > input_file_1.txt.out & ./program input_file_2.txt > input_file_2.txt.out & After then, only run the... (1 Reply)
Discussion started by: edge_diners
1 Replies

6. Shell Programming and Scripting

Help with control flow in a Bash script

In my bash script I want to say "if argument 2 is anything except x, y or z, than echo this" (x y and z being words). So my script looks like this: if ] then echo "unrecognized input: $2" fi This usually works but than I also want to say "if argument 2 IS x, y, or z, but argument 4 is... (4 Replies)
Discussion started by: Jrodicon
4 Replies

7. Red Hat

Bash: menu-complete and reverse

Hi, In the archives I found this: And this works fine. $if mode=vi "\C-0-": digit-argument TAB: menu-complete "\e But what I want is to reverse this. So I want that tab does reverse menu completion and shift tab does normal menu completion. Can anyone help me with this? Thanks (0 Replies)
Discussion started by: ozkanb
0 Replies

8. Shell Programming and Scripting

Curl won't complete in a script but does from prompt. Idea?

On RHEL5 from within both a shell (sh->bash) and a csh script curl fails with a "curl: (6) Couldn't resolve host 'application'" error. This is the result whether run as a command at the shell and/or c-shell prompt and curl also fails with the same error when the scripts are "source'd" at the... (5 Replies)
Discussion started by: GSalisbury
5 Replies

9. 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

10. 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... (1 Reply)
Discussion started by: radha254
1 Replies
CURLOPT_COOKIEJAR(3)					     curl_easy_setopt options					      CURLOPT_COOKIEJAR(3)

NAME
CURLOPT_COOKIEJAR - file name to store cookies to SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_COOKIEJAR, char *filename); DESCRIPTION
Pass a filename as char *, zero terminated. This will make libcurl write all internally known cookies to the specified file when curl_easy_cleanup(3) is called. If no cookies are known, no file will be created. Specify "-" as filename to instead have the cookies writ- ten to stdout. Using this option also enables cookies for this session, so if you for example follow a location it will make matching cook- ies get sent accordingly. Note that libcurl doesn't read any cookies from the cookie jar. If you want to read cookies from a file, use CURLOPT_COOKIEFILE(3). If the cookie jar file can't be created or written to (when the curl_easy_cleanup(3) is called), libcurl will not and cannot report an error for this. Using CURLOPT_VERBOSE(3) or CURLOPT_DEBUGFUNCTION(3) will get a warning to display, but that is the only visible feedback you get about this possibly lethal situation. Since 7.43.0 cookies that were imported in the Set-Cookie format without a domain name are not exported by this option. The application does not have to keep the string around after setting this option. DEFAULT
NULL PROTOCOLS
HTTP EXAMPLE
TODO AVAILABILITY
Along with HTTP 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_COOKIEFILE(3), CURLOPT_COOKIE(3), CURLOPT_COOKIELIST(3), libcurl 7.54.0 December 21, 2016 CURLOPT_COOKIEJAR(3)
All times are GMT -4. The time now is 02:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy