‼
To give you the best experience, this site uses cookies. Continuing to use
9bis.net
means you agree to our use of cookies.
For_Do_Done
(
en )
Last modification : 2013/01/26 19:16
Index
/
Recent changes
/
News
/
Forum
/
Download
/
Contact
Edit (
Help
) /
Rename
/
History
The '''for''' is a predefined loop. The syntax is{for ''variable'' in ''listofvalues'' do ''command'' done}The command is executed for each element of the list of values. Example:{msh> for i in 1 2 3 1> do 1> print $i 1> done 1 2 3}The list of values can be build with such specific expressions: '''1..10''' : will be replaced by '''1 2 3 4 5 6 7 8 9 10''' '''1..2..10''' : will be replaced by '''1 3 5 7 9''' '''*.txt''': will be replaced by the list of files that match the pattern '''*.txt''' The previous example can be written as {msh> for i in 1..3 ; do print $i ; done 1 2 3}
Password :
Wiki utilisant
PumaWiki 1.0
2025/05/09 17:39 -- en -- 3.148.243.252