Sponsored Content
Top Forums Shell Programming and Scripting Curl statement throwing extra statements Post 302961334 by Junaid Subhani on Thursday 26th of November 2015 08:45:44 PM
Old 11-26-2015
Curl statement throwing extra statements

Hi all,

I am running a curl statement in my script to extract some information form a remote server.

My curl statement is :

Code:
curl --socks5 142.133.134.164:1082 'http://11.229.52.71:8011/WebApp/common/version'

This gives me an output of :


Code:
[root@Redhat6664x scripts]$ curl --socks5 142.133.134.164:1082 'http://11.229.52.71:8011/WebApp/common/version'
<html><head><title>Version Rev-632_20151524</title></head><body><pre>
VERSION=Rev-632_20151119142524
PRODUCT=My
BUILD_VERSION=Rev
      SRC_TAG=R2.3.0.48
      GIT_TAG=ce8bc092f184b11cae797e41165a0553c5b53f45
     JOB_NAME=C_DEV
 BUILD_NUMBER=632
   BUILD_DATE=Thu Nov 19 14:28:54 2015
</pre></body></html>
      VERSION=R2.3.0-48.1
BUILD_VERSION=R2.3.0
BUILD_RELEASE=48.1

I am trying to extract only some data like the lines that have VERSION in them but when I do that using grep , I see some extra lines coming in :

Code:
[root@Redhat6664x scripts]$ curl --socks5 142.133.134.164:1082 'http://11.229.52.71:8011/WebApp/common/version' | grep VERSION
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
105  1261  105  1261    0     0   8402      0 --:--:-- --:--:-- --:--:-- 12362
VERSION=Rev-632_20151119142524
BUILD_VERSION=Rev
VERSION=R2.3.0-48.1

There is this extra text coming in:

Code:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
105  1261  105  1261    0     0   8402      0 --:--:-- --:--:-- --:--:-- 12362

How can I get rid of this in the curl statement ?
 

10 More Discussions You Might Find Interesting

1. AIX

lsof64 throwing memory fault

lsof64 throws a memory fault because of the large number of connections on the box, is there a way around it? (1 Reply)
Discussion started by: designflaw
1 Replies

2. Programming

With daemonize() throwing exception.

I have a function for daemonize() and then I call this to my main(). Here below is my main... int main(int argc, char **argv) { daemonize(); try{ ............ if(fail()) throw Exception(...) ......... } catch (const Exception& e) { cout<< (e.toString()); return -1 } here if... (4 Replies)
Discussion started by: SamRoj
4 Replies

3. Shell Programming and Scripting

bc throwing coredump

Hi Gurus, I tried bc 1000 % 10 on tcsh and ksh and its throwing a core dump on a sun solaris machine. uname -a SunOS azote 5.9 Generic_118558-39 sun4u sparc SUNW,Ultra-4 Please let me know if you find anything. Thanks, Kinny (8 Replies)
Discussion started by: kinny
8 Replies

4. Shell Programming and Scripting

for loop throwing an error

Hi Guys, I am trying a simple for loop which is throwing an error. Below is my code: #/bin/sh set -A array "are" "you" "there"; for ( i = 0 ; i < ${#array} ; i++ ) do echo ${array} done I am getting this error tci001wasd02 $ sh -vx array_for.sh #/bin/sh set -A array "are"... (6 Replies)
Discussion started by: mac4rfree
6 Replies

5. Shell Programming and Scripting

for loop with internal unix command in statement throwing error

Hi I've gotten a plugin script that won't run. I keeps throwing an error at the following line. for BARCODE_LINE in `cat ${TSP_FILEPATH_BARCODE_TXT} | grep "^barcode"` do #something done The error reads ... (3 Replies)
Discussion started by: jdilts
3 Replies

6. Shell Programming and Scripting

Tr--translate is throwing an error

Dear all, I would like to count the no;of word "INFORMATION" in a file called alt.lst and output to a unix variable INFORMATION.so to do this I wrote the below code INFORMATION=echo 'INFORMATION' | tr -cs 'A-Za-z' '\n' < /app/tisq005/01/home/tisq005b/scripts/alt.lst | grep -c "INFORMATION"... (2 Replies)
Discussion started by: Kiransagar
2 Replies

7. Shell Programming and Scripting

awk--throwing an error

Hi all, I have below code sqlplus -s ext/exo@TIS << EOF whenever sqlerror exit failure rollback; set echo off set head off set serveroutput on set termout on set trimspool on SPOOL $SPOOL_FILE select 'ROWS '|| ' '||decode((count(Part_no)),0,'With greater values not... (3 Replies)
Discussion started by: Kiransagar
3 Replies

8. Shell Programming and Scripting

Function throwing an error

Hi All I have two shell scripts where the second is getting invoked from the first. E.g. test1.sh and test2.sh Within test1, the code is something like this: #!/bin/bash . test2.sh usage() { echo "..." echo "....." } SRC=$1 DEST=$2 case "$3" in tran) doTran ;; *)... (7 Replies)
Discussion started by: swasid
7 Replies

9. Shell Programming and Scripting

For Loop throwing error

Hello Gurus, I am writing one script at linux. The logic is There is a find command which will find some specific files daily and store at a variable Then echo that variable . Now when I am trying to read the variable by using for loop it is throwing error as below:cat: CKDT.dat: No such... (5 Replies)
Discussion started by: pokhraj_d
5 Replies

10. Shell Programming and Scripting

Can we convert 3 awk statements in a single statement

Hi, Can we use 3 statements convert in a single statement. First statement output using the second statement and the second statement output using the third statement please let me know the syntax so that I can able to merge all the three statement. (2 Replies)
Discussion started by: Priti2277
2 Replies
CURLOPT_NOBODY(3)					     curl_easy_setopt options						 CURLOPT_NOBODY(3)

NAME
CURLOPT_NOBODY - do the download request without getting the body SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NOBODY, long opt); DESCRIPTION
A long parameter set to 1 tells libcurl to not include the body-part in the output when doing what would otherwise be a download. For HTTP(S), this makes libcurl do a HEAD request. For most other protocols it means just not asking to transfer the body data. Enabling this option means asking for a download but without a body. DEFAULT
0, the body is transferred PROTOCOLS
Most EXAMPLE
curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* get us the resource without a body! */ curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); /* Perform the request */ curl_easy_perform(curl); } AVAILABILITY
Always RETURN VALUE
Returns CURLE_OK SEE ALSO
CURLOPT_HTTPGET(3), CURLOPT_POST(3), libcurl 7.54.0 February 03, 2016 CURLOPT_NOBODY(3)
All times are GMT -4. The time now is 12:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy