Comparing two array in shell script

view full story

http://www.unix.com – In shell script i have two variables with value Code: debit_sal="DOG,HIU,JIU,GYT,PPI,KIU,HUY........." debit_req='HIU, JIU, HUY, GTR, KOI, ............"   i stored this two in two array arr=$(echo $debit_sal| tr "," "\n"); arr1=$(echo $debit_req| tr ", " "\n"); #(note second arry has comma with space) set -A dfArr $arr set -A drArr $arr1 echo $dfArrr echo $drArr x=${#dfArrr[@]} y=${#drArrr[@]} I need compare this two array and find out / print in console what are all codes extra in each array .. i am not able to proceed the way (HowTos)