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

Comments

Popular posts from this blog

OS/DB Migration - CMD. STR, TOC, EXT, R3load, DDLDBS.TPL and more

Fixing Inconsistent Table - Table activation fails due to inconsistency between DD and DB

301 Redirect Using SAP Web Dispatcher