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: Query to Link OM Order Source with AR Grouping Rules and Attributes

SELECT      hou.name,     rtsa.name "Order Source/Transaction Source",     rtsa.description "Description",     gr1.name ...