shell script

General support questions
Post Reply
knzzz
Posts: 157
Joined: 2017/02/25 12:41:42

shell script

Post by knzzz » 2018/03/30 03:48:08

Hi

if the condition is not satisfied then how to repeat the same process for n number for (eg: exactly 5 times) times then exiting the loop

Regards
Kanna

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: shell script

Post by Whoever » 2018/03/30 05:19:41

Code: Select all

for i in {1..5} ; do if [ a == b ] ; then break ; fi; echo "loop count $i" ; done

Post Reply