The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-20-2008
keshav_rk keshav_rk is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 3
Generate a Sequence like in Oracle

#!/usr/bin/ksh

ValUniqueNo=0
export ValUniqueNo

FnGenerateUniqueNo()
{
(( ValUniqueNo = $ValUniqueNo + 1 ))
echo $ValUniqueNo
export ValUniqueNo=$ValUniqueNo
}

echo k1=`FnGenerateUniqueNo`
echo k2=`FnGenerateUniqueNo`

kindly consider the above script.
it is required that when the function is called value of ValUniqueNo should be incremented.

Can any body help me...