|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I've got a simple script going that parses through looking for files in a certain range of numbers and grabs them with wget, but I'm stuck on one thing. Here's what I need:
I've got two strings, one is a prefix "wget http://website.com/images/image0" and the other is a suffix, ".jpg". I want to sandwich between those two an integer that increments. I've got the loop going fine, I just don't know how to get it to stick together and become a single command inside the loop. I did know how to do this in Java back in the day, but I'll be buggered if I can get this to work
|
|
|||
|
|
|
|||
|
Quote:
|
|
|||
|
If your integers have to be a certain width, then use printf.
wget http://website.com/images/image$(printf "%02d" $i).jpg The $() construct is bash specific though. If you want to be portable to sh, then use backticks ``. |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|