4
votes
3answers
98 views

How can I pass argument stored on a variable to WGET

I'm writing a bash script that extensively uses wget. To define all common parameters in one place I store them on variables. Here's a piece of code: useragent='--user-agent="Mozilla/5.0 (Windows NT ...
2
votes
2answers
100 views

wget to get list of files

im using wget in a bash script to get a list of files from a website, the files are sequential and in the format http://site.com/00001.csv etc, is there a way to terminate/end the script when I hit ...
1
vote
1answer
90 views

syntax error in conditional expression while executing the shell script?

I am working on a project in which I need to make a url call to one of my server from the bash shell script.. http://hostname.domain.com:8080/beat After hitting the above url, I will be getting the ...
6
votes
4answers
373 views

Using sed to add a URL to the start of every line

I have the URL (see below) of a certain web page that lists many different versions of a software package. URL=http://ftp.gnu.org/gnu/wget/ The following one-liner gets me the latest version tar ...
1
vote
1answer
539 views

Running thousands of curl background processes in parallel in bash script

I am running thounsand of curl background processes in parallel in the following bash script START=$(date +%s) for i in {1..100000} do curl -s "http://some_url_here/"$i > $i.txt& ...
2
votes
5answers
517 views

Bash: Fastest way of determining dimensions of image from URL

I'm trying to figure out a really fast method in bash of determining an images dimensions. I know I could wget the image and then use imagemagick to determine the height and width of the image. I'm ...
3
votes
3answers
742 views

Using wget to get file names from a text file

I have found a website that hosts a few files that I'm after, there's too many to download them all individually. The filenames take a fairly standard and reproduceable form i.e. 1_a, 1_b, 1_c etc Is ...
2
votes
1answer
197 views

Method to perform DNS lookup step very quickly during wget

When I download any document from internet using wget. It shows maximum amount of time consumed in getaddrinfo(). I know getaddrinfo() used for DNS lookup. Tell me any method, so that this time is ...
0
votes
1answer
352 views

Bash While loops

I have a loop set up like the following #!/bin/bash cat $1|while read line;do wget --limit-rate=50k http://url/$line.json -O got-$line; if [ "$?" -ne "0" ]; then rm got-$line; fi ...
4
votes
2answers
317 views

Download from dynamically changing urls via script

I want to write a script to download all Walter Lewin lectures from this page in wmv format: http://videolectures.net/mit801f99_physics_classical_mechanics/ However the links to the wmv file for ...
1
vote
1answer
216 views

What is wget idiom for curl -o?

So I use code in some function like if [ ! -e $DOWNLOADS/$1 ]; then echo_run curl -L http://$4/$5/$1 -o $DOWNLOADS/$1 fi I wonder how to achieve the same thing without curl?
4
votes
2answers
10k views

Set a network range in the no_proxy environment variable

I'm in a network using a proxy. I've got machines using lots of scripts here and there accessing each other over HTTP. The network is 10.0.0.0/8. My proxy is 10.1.1.1:81, so I set it up accordingly: ...
0
votes
1answer
462 views

Force wget to download only from HTTPS?

wget https://skype.com -O - > /dev/null isn't good. I just want to create a short bash script to check that an HTTPS cert is valid or no. i think wget doesn't connects if the cert is invalid. i ...