What we have seen so far enables us to interact with the user, process the input, and provide some output based on conditions we imposed. All of this is fine; and if the user calls our scripts with some arguments, we can store them in an array and process given that we know how many options they are passing to the command line. We must know in advance how many items the user will provide us with, otherwise we will lose those in excess. This is where an iterative construct comes in play. Since we already saw some examples, it can enumerate the content of an array and let us process its content without knowing in advance the number of items stored. In this chapter, we will have a look at how to use the for loop and while/until loop to get a strong grip on the data the user provides us with.
United States
United Kingdom
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Argentina
Austria
Belgium
Bulgaria
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
Greece
Hungary
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Singapore
Slovakia
Slovenia
South Africa
South Korea
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine