Tuesday, January 1, 2013

UNTIL loop example in Shell Script

LIMIT=10
var=0
until (( var > LIMIT ))
do  # ^^ ^     ^     ^^   No brackets, no $ prefixing variables.
  echo -n "$var "
  (( var++ )) ## increment operator in shell script
done    # 0 1 2 3 4 5 6 7 8 9 10
echo
exit 0

OUTPUT :

-bash-3.2$ sh until_sh
0 1 2 3 4 5 6 7 8 9 10
-bash-3.2$

No comments:

Post a Comment

Price List Query for Item

 SELECT qph.list_header_id,        qph.name,        qph.description,        qphh.start_date_active,        qphh.currency_code,        q...