Sponsored Content
Top Forums Shell Programming and Scripting Encapsulating output of CURL and/or WGET Post 302706839 by Corona688 on Thursday 27th of September 2012 01:35:32 PM
Old 09-27-2012
How about just letting it print instead of continually cramming everything into backticks? You don't have to always have to do that.

Also, how about checking their return codes instead of grepping their output? Every process you create returns an error code for success or failure, and wget is not an exception. If it fails to download a page, it willl tell you so directly. There's no need to grep for 'error' in the output.

If you're downloading multiple pages and wish to see which succeeded via script, wget has the -nv option, which outputs success or failure for individual files in a simple line-by-line list.

The real problem is, they're not one thing, they're two streams. stdout is used for data, stderr is used for errors.

If you want them both to go to stdout: wget ... 2>&1
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed in Curl & Wget

We are trying to invoke a https service from our unix script using curl command. The service is not getting invoked because it is SSL configured. Bypassing certification (using curl –k) does not work. curl -k https://site curl -k -x IP:Port https://site curl -k -x IP:443 https://id:pwd@site ... (0 Replies)
Discussion started by: dineshbabu01
0 Replies

2. Shell Programming and Scripting

Proxy with curl/wget support

I need a proxy that would enable me to use cli curl/wget with another ip address. How do I find a paid proxy server that supports curl/wget? (1 Reply)
Discussion started by: locoroco
1 Replies

3. Shell Programming and Scripting

ery weird wget/curl output - what should I do?

Hi, I'm trying to write a script to download RedHat's errata digest. It comes in a txt.gz format, and i can get it easily with firefox. HOWEVER: output is VERY strange when donwloading it in a script. It seems I'm getting a file of the same size - but partially text and partly binary! It... (5 Replies)
Discussion started by: jstilby
5 Replies

4. Shell Programming and Scripting

Specifying IP address with curl/wget

Hello, I am wondering does anyone know of a method using curl/wget or other where by I could specify the IP address of the server I wish to query for a website. Something similar to editing /etc/hosts but that can be done directly from the command line. I have looked through the man pages... (4 Replies)
Discussion started by: colinireland
4 Replies

5. Shell Programming and Scripting

How to download file without curl and wget

Hi I need a Shell script that will download a zip file every second from a http server but i can't use neither curl nor wget. Can anyone will help me go about this task ??? Thanks!! (1 Reply)
Discussion started by: rubber08
1 Replies

6. Shell Programming and Scripting

Wget vs Curl - Proxy issue

Hi, My script needs to crawl the data from a third party site. Currently it is written in wget. The third party site is of shared interface with different IP addresses. My wget works with all the IP address but not with one. Whereas the curl is able to hit that IP address and comes out... (2 Replies)
Discussion started by: sathyaonnuix
2 Replies

7. Shell Programming and Scripting

Wget/curl credentials validation

Experts, I login to a 3rd party and pull some valuable information with my credentials. I pass my credentials via --post-data in wget. Now my Account is locked. I want my wget to alert that the Account is locked. How can i achieve this. My idea is, get the Source page html from the... (2 Replies)
Discussion started by: sathyaonnuix
2 Replies

8. Shell Programming and Scripting

How to get content of a webpage Curl vs Wget?

Hello, What I am trying to do is to get html data of a website automatically. Firstly I decided to do it manually and via terminal I entered below code: $ wget http://www.***.*** -q -O code.html Unfortunately code.html file was empty. When I enter below code it gave Error 303-304 $... (1 Reply)
Discussion started by: baris35
1 Replies

9. Shell Programming and Scripting

Wget and curl to post data

i'm using this command to post data to a remote host: wget --post-data="My Data" http://<my-ip>:80 -O /dev/null -q and curl --data "My Data" http://<my-ip>:80 however, when i run the above, i see the following in my access log on the remote host: Wget: 10.10.10.10 - - "POST /... (1 Reply)
Discussion started by: SkySmart
1 Replies

10. Web Development

Wget/curl and javascript

What can I use instead of wget/curl when I need to log into websites that use javascript? Wget and curl don't handle javascript. (6 Replies)
Discussion started by: locoroco
6 Replies
DGET(1) 																   DGET(1)

NAME
dget -- Download Debian source and binary packages SYNOPSIS
dget [options] URL ... dget [options] package[=version] DESCRIPTION
dget downloads Debian packages. In the first form, dget fetches the requested URLs. If this is a .dsc or .changes file, then dget acts as a source-package aware form of wget: it also fetches any files referenced in the .dsc/.changes file. The downloaded source is then checked with dscverify and, if successful, unpacked by dpkg-source. In the second form, dget downloads a binary package (i.e., a .deb file) from the Debian mirror configured in /etc/apt/sources.list(.d). Unlike apt-get install -d, it does not require root privileges, writes to the current directory, and does not download dependencies. If a version number is specified, this version of the package is requested. In both cases dget is capable of getting several packages and/or URLs at once. (Note that .udeb packages used by debian-installer are located in separate packages files from .deb packages. In order to use .udebs with dget, you will need to have configured apt to use a packages file for component/debian-installer). Before downloading files listed in .dsc and .changes files, and before downloading binary packages, dget checks to see whether any of these files already exist. If they do, then their md5sums are compared to avoid downloading them again unnecessarily. dget also looks for matching files in /var/cache/apt/archives and directories given by the --path option or specified in the configuration files (see below). Finally, if downloading (.orig).tar.gz or .diff.gz files fails, dget consults apt-get source --print-uris. Download backends used are curl and wget, looked for in that order. dget was written to make it easier to retrieve source packages from the web for sponsor uploads. For checking the package with debdiff, the last binary version is available via dget package, the last source version via apt-get source package. OPTIONS
-b, --backup Move files that would be overwritten to ./backup. -q, --quiet Suppress wget/curl non-error output. -d, --download-only Do not run dpkg-source -x on the downloaded source package. This can only be used with the first method of calling dget. -x, --extract Run dpkg-source -x on the downloaded source package to unpack it. This option is the default and can only be used with the first method of calling dget. -u, --allow-unauthenticated Do not attempt to verify the integrity of downloaded source packages using dscverify. --build Run dpkg-buildpackage -b -uc on the downloaded source package. --path DIR[:DIR ...] In addition to /var/cache/apt/archives, dget uses the colon-separated list given as argument to --path to find files with a matching md5sum. For example: "--path /srv/pbuilder/result:/home/cb/UploadQueue". If DIR is empty (i.e., "--path ''" is specified), then any previously listed directories or directories specified in the configuration files will be ignored. This option may be specified multiple times, and all of the directories listed will be searched; hence, the above example could have been written as: "--path /srv/pbuilder/result --path /home/cb/UploadQueue". --insecure Allow SSL connections to untrusted hosts. --no-cache Bypass server-side HTTP caches by sending a Pragma: no-cache header. -h, --help Show a help message. -V, --version Show version information. CONFIGURATION VARIABLES
The two configuration files /etc/devscripts.conf and ~/.devscripts are sourced by a shell in that order to set configuration variables. Command line options can be used to override configuration file settings. Environment variable settings are ignored for this purpose. The currently recognised variable is: DGET_PATH This can be set to a colon-separated list of directories in which to search for files in addition to the default /var/cache/apt/archives. It has the same effect as the --path command line option. It is not set by default. DGET_UNPACK Set to 'no' to disable extracting downloaded source packages. Default is 'yes'. DGET_VERIFY Set to 'no' to disable checking signatures of downloaded source packages. Default is 'yes'. BUGS AND COMPATIBILITY
dget package should be implemented in apt-get install -d. Before devscripts version 2.10.17, the default was not to extract the downloaded source. Set DGET_UNPACK=no to revert to the old behaviour. AUTHOR
This program is Copyright (C) 2005-08 by Christoph Berg <myon@debian.org>. Modifications are Copyright (C) 2005-06 by Julian Gilbey <jdg@debian.org>. This program is licensed under the terms of the GPL, either version 2 of the License, or (at your option) any later version. SEE ALSO
apt-get(1), debcheckout(1), debdiff(1), dpkg-source(1), curl(1), wget(1). Debian Utilities 2013-12-23 DGET(1)
All times are GMT -4. The time now is 01:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy