Hi,
Please find the attached scriplet and suggest me to fix the bug in this.
-----------------------------------
noofdirs=`ls *.tar | wc -l`
if [ "$noofdirs" != 0 ] ; then
let i=1
while ( $i <= $noofdirs ) ;
do
echo $i
mkdir $i
file1=`ls *.tar | head -1`
mv $file1 $i
i = `expr $i + 1`
echo $i
done
fi
------------------------------------
I want to create the directory according to tar files. If i 3 tar file, it shuold create 3 directories by the name 1,2 and 3.
Rgds,
Sharif.