Cleaning empty directories using the Do–While construct

In the last recipe, we found the second Sunday of May using the year as input. We used a While loop for that. The While loop checks the condition before even starting the iteration. If the condition returns $false at the very beginning, the loop would not even begin; for instance, if you input the year as 2016.

Do–While is a little different; the loop is executed once whether the condition is true or not. The condition is checked only after the first iteration.

The scenario for this recipe is that we want to delete all empty directories within a certain directory.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.202.167