I need to save two command line arguments in two different variables and rest all in third variable.
I am using following code
while [ $# -ge 2 ] ; do
You're not entering the loop when you have more than two arguments. You can bump the argument limit like so:
while [ $# -ge 3 ]; do : done
or better yet just parse your arguments without looping at all. For example:
DirFrom="$1" Old_Ver=`basename "$1"` DirTo="$2" pdct_code="$*"