Try downloading images with zeros using wget [duplicate]
This question already has an answer here:
How to zero pad a sequence of integers in bash so that all have the same width?
10 answers
When I run the following command in linux:
wget http://page.com/{0000..0100}.jpg
he tries to download the following sequence:
http://page.com/0.jpg
http://page.com/1.jpg
http://page.com/2.jpg
http://page.com/3.jpg
...
http://page.com/100.jpg
that is, it does not place the zeros.
bash
marked as duplicate by zerkms, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 23 at 5:29
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How to zero pad a sequence of integers in bash so that all have the same width?
10 answers
When I run the following command in linux:
wget http://page.com/{0000..0100}.jpg
he tries to download the following sequence:
http://page.com/0.jpg
http://page.com/1.jpg
http://page.com/2.jpg
http://page.com/3.jpg
...
http://page.com/100.jpg
that is, it does not place the zeros.
bash
marked as duplicate by zerkms, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 23 at 5:29
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How to zero pad a sequence of integers in bash so that all have the same width?
10 answers
When I run the following command in linux:
wget http://page.com/{0000..0100}.jpg
he tries to download the following sequence:
http://page.com/0.jpg
http://page.com/1.jpg
http://page.com/2.jpg
http://page.com/3.jpg
...
http://page.com/100.jpg
that is, it does not place the zeros.
bash
This question already has an answer here:
How to zero pad a sequence of integers in bash so that all have the same width?
10 answers
When I run the following command in linux:
wget http://page.com/{0000..0100}.jpg
he tries to download the following sequence:
http://page.com/0.jpg
http://page.com/1.jpg
http://page.com/2.jpg
http://page.com/3.jpg
...
http://page.com/100.jpg
that is, it does not place the zeros.
This question already has an answer here:
How to zero pad a sequence of integers in bash so that all have the same width?
10 answers
bash
bash
edited Nov 23 at 0:12
melpomene
58.7k54489
58.7k54489
asked Nov 23 at 0:07
alex
226
226
marked as duplicate by zerkms, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 23 at 5:29
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by zerkms, tripleee
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 23 at 5:29
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Consider upgrading Bash. Your code works on Bash4+:
$ echo $BASH_VERSION {001..003}
4.4.19(1)-release 001 002 003
but not on older versions like Bash 3.x:
$ echo $BASH_VERSION {001..003}
3.2.57(1)-release 1 2 3
If you're unable to upgrade, you can use printf
as a workaround:
wget $(printf "http://page.com/%04d.jpgn" {1..100})
add a comment |
The bash expansion isn't going to pad teh numbers to use mathematically insignificant zeros. You can use seq
with the -w
(width) option to pad with leading zeros.
for i in `seq -w 1 1000`
do
wget http://example.com/path/to/$i.jpg
done
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Consider upgrading Bash. Your code works on Bash4+:
$ echo $BASH_VERSION {001..003}
4.4.19(1)-release 001 002 003
but not on older versions like Bash 3.x:
$ echo $BASH_VERSION {001..003}
3.2.57(1)-release 1 2 3
If you're unable to upgrade, you can use printf
as a workaround:
wget $(printf "http://page.com/%04d.jpgn" {1..100})
add a comment |
Consider upgrading Bash. Your code works on Bash4+:
$ echo $BASH_VERSION {001..003}
4.4.19(1)-release 001 002 003
but not on older versions like Bash 3.x:
$ echo $BASH_VERSION {001..003}
3.2.57(1)-release 1 2 3
If you're unable to upgrade, you can use printf
as a workaround:
wget $(printf "http://page.com/%04d.jpgn" {1..100})
add a comment |
Consider upgrading Bash. Your code works on Bash4+:
$ echo $BASH_VERSION {001..003}
4.4.19(1)-release 001 002 003
but not on older versions like Bash 3.x:
$ echo $BASH_VERSION {001..003}
3.2.57(1)-release 1 2 3
If you're unable to upgrade, you can use printf
as a workaround:
wget $(printf "http://page.com/%04d.jpgn" {1..100})
Consider upgrading Bash. Your code works on Bash4+:
$ echo $BASH_VERSION {001..003}
4.4.19(1)-release 001 002 003
but not on older versions like Bash 3.x:
$ echo $BASH_VERSION {001..003}
3.2.57(1)-release 1 2 3
If you're unable to upgrade, you can use printf
as a workaround:
wget $(printf "http://page.com/%04d.jpgn" {1..100})
answered Nov 23 at 2:19
that other guy
71.8k885123
71.8k885123
add a comment |
add a comment |
The bash expansion isn't going to pad teh numbers to use mathematically insignificant zeros. You can use seq
with the -w
(width) option to pad with leading zeros.
for i in `seq -w 1 1000`
do
wget http://example.com/path/to/$i.jpg
done
add a comment |
The bash expansion isn't going to pad teh numbers to use mathematically insignificant zeros. You can use seq
with the -w
(width) option to pad with leading zeros.
for i in `seq -w 1 1000`
do
wget http://example.com/path/to/$i.jpg
done
add a comment |
The bash expansion isn't going to pad teh numbers to use mathematically insignificant zeros. You can use seq
with the -w
(width) option to pad with leading zeros.
for i in `seq -w 1 1000`
do
wget http://example.com/path/to/$i.jpg
done
The bash expansion isn't going to pad teh numbers to use mathematically insignificant zeros. You can use seq
with the -w
(width) option to pad with leading zeros.
for i in `seq -w 1 1000`
do
wget http://example.com/path/to/$i.jpg
done
answered Nov 23 at 0:44
ivanivan
1,594258
1,594258
add a comment |
add a comment |