| | |
Can somebody help with looping my command?
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Apr 2009
Posts: 2
Reputation:
Solved Threads: 0
Hi,
I am using a set of tools called FWTools which runs commands in the shell window. One command that I am using edits tif files by adding an overview to the file. The syntax is:
gdaladdo -r average "D:\Map Files\Tiffs\ST00.TIF" 2 4 8 16 32
What I need to do is run this command on 800 files in the directory D:\Map Files\Tiffs - is this possible?
I was thinking something like:
for %x in (*.tif) do gdaladdo -r average %x 2 4 8 16 32 but am not getting very far.
Any help or advice is welcome.
Regards
JD
I am using a set of tools called FWTools which runs commands in the shell window. One command that I am using edits tif files by adding an overview to the file. The syntax is:
gdaladdo -r average "D:\Map Files\Tiffs\ST00.TIF" 2 4 8 16 32
What I need to do is run this command on 800 files in the directory D:\Map Files\Tiffs - is this possible?
I was thinking something like:
for %x in (*.tif) do gdaladdo -r average %x 2 4 8 16 32 but am not getting very far.
Any help or advice is welcome.
Regards
JD
Software-Matters
Simple Solutions That Work
Simple Solutions That Work
0
#2 Oct 8th, 2009
Just take the echo out of the command:
bash Syntax (Toggle Plain Text)
sk@svn:/tmp/tif$ touch 1.tif 2.TiF 3.TIF sk@svn:/tmp/tif$ find ./ -type f -iname \*.tif -exec echo gdaladdo -r average \"{}\" 2 4 8 16 32 \; gdaladdo -r average "./2.TiF" 2 4 8 16 32 gdaladdo -r average "./1.tif" 2 4 8 16 32 gdaladdo -r average "./3.TIF" 2 4 8 16 32
![]() |
Similar Threads
- need help w/ a program using static methods, arrays using files from command prompt (Java)
- Need help with a looping problem (Python)
- Want to execute a command on all files recursively (C#)
- C command-line I/O question (C++)
- DOS "ROUTE" command (Visual Basic 4 / 5 / 6)
- command line (OS X)
- Graphics Card issues Stop Command??? (Windows NT / 2000 / XP)
Other Threads in the Shell Scripting Forum
- Previous Thread: Help With Case Nesting(Restaurant Ordering Simulator)
- Next Thread: This is the error i get when i run my script: Unmatched `
Views: 643 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Shell Scripting






