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

Oracle EBS R12 – Query to View Consolidated Invoice Details with Individual Transactions

SELECT     hp.party_name                  AS customer_name,     aca.account_number             AS customer_account,     hci.cons_billing_num...