[Home]ForLoop

Home | RecentChanges | Preferences

Difference (from prior major revision) (no other diffs)

Added: 20a21,26
You can also use "*":

foreach x (*.txt)
cp $x /home/yourname/tmp/$x
end


Added: 21a28,29



For Loops

For example:

  foreach x (1 2 3)
     echo $x
  end

More interesting:

  foreach x (a b c)
    echo cp $x blah/$x
  end

Still more interesting:

  foreach x (foo.txt bar.txt baz.txt)
    cp $x /home/yourname/tmp/$x
  end

You can also use "*":

  foreach x (*.txt)
    cp $x /home/yourname/tmp/$x
  end

-- LionKimbro


Home | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited November 8, 2003 23:44 (diff)
Search: