Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Simple BASH tutorial: the for loop

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,550
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 12, 2008

This is a quick once over of some really common for looping uses and options. A small collection of commands that i found really useful in the early days.

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (6)

Sign In or Sign Up now to post a comment!
  • #!/bin/bash

    x=0

    for f in $( ls *.sid); do x=`expr $x + 1`

    # echo number of file we are on + name of file echo $x $f

    # perform analysis, output to new file gdal_translate -of GTiff -outsize 31238 39915 $f res_$f

    done

    I need this script to loop through a folder of images on windows and change the pixels and format from .sid to .tif using Gdal but it run can use please help. I have python and cygwin on my pc but this is my first time using any of these programs.

  • I'm surprised you don't have 20 comments asking you how you got your shell to work like that (auto erasing echos and wget progress). Of course, I know you fudged it yourself. Probably a bit confusing for someone trying to learn.

  • Thanks a lot!! pretty much helpful

  • Thanks for posting this. I was easily able to figure out how to download 26 embedded flash videos from a web site via the command line w/curl based on the example given at 1:13

  • ceauless bulaaaaaaan

  • Thanks!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more