Does KornShell (ksh) have a Do...While loop?
Yes, the standard while
loop in ksh
supports this out of the box:
while ...; do ...; done
The standard while
loop has code blocks before and after do
.
Each block may contain multiple commands. Conventionally we use onlya single command for the first block, and its exit status determines whetherthe loop terminates or is continued.
When we use multiple commands, onlythe status of the last command matters.
while echo do this always # replace with your code [[ -n "${FILES%%,*}" ]]do FILE="${FILES%%,*}" FILES="${FILES#*,}"done