Laynetworks  
Web laynetworks.com Google
Home | Site Map | Tell a friends
Management Tutorials
Download
Tutorials
History
Computer Science
Networking
OS - Linux and Unix
Source Code
Script & Languages
Protocols
Glossary
IGNOU
Quiz
About Us
Contact Us
Feedback
 
Sign up for our Email Newsletter
 
Get Paid for Your Tech Turorials / Tips

 

 

Home > Source Code > Shell Script
Page : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Shell Script
 
Shell script to remove all numbers that occurs more than once in an ordered array
clear
echo "Enter the number of numbers:"
read limit
count=1
echo "Enter the numbers in sorted order"
while [ $count -le $limit ]
do
eval read x$count
count=`expr $count + 1`
done
i=1
while [ $i -le $limit ]
do
eval xval = "\$x$i"
j=`expr $i + 1`
while [ $j -le $limit ]
do
eval yval="\$x$j"
if [ $xval -eq $yval ]
then
pos=j
while [ $pos -le $limit ]
do
n=`expr $pos + 1
eval x$pos=x$n
done
limit=`expr $limit -1`
i=`expr $i - 1`
fi
j=`expr $j + 1`
done
count =1
echo " The array without duplication is "
while [ $count -le $limit ]
do
eval echo "\$x$count"
count=`expr $count + 1`
done
 
Page : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 
Donation | Useful links | Link to Laynetworks.com | Legal | SharePoint Development
Copyright © 2000-2010 Lay Networks All rights reserved.