skip to main content

SAP NetWeaver Newbie

Loops in UNIX Shell Scripts - until Statement

The until construct allows iterations through a block of script as long as a certain condition is false.

Syntax:

until condition
do
commands
done

Example:

The example script counts up to 10 secs.

#!/bin/sh

i=1
until [ $i -gt 10 ];
do
   sleep 1
   print "$i"
   i=` expr $i + 1 `
done

exit 0

No comments:

Post a Comment

Email Subscription

Get every new post into your inbox by subscribing us.

Want a reason to subscribe?
1. This sitemap might convince you to subscribe.
2. We do not misuse email IDs. We respect privacy.

© 2008 - 2017 sapnwnewbie. All rights reserved.