i have my shell code:
#!/bin/sh
if [ ! -d $1 ]
then echo $1 nu este director
exit1
fi
ls -R $1 >temp
permission= ls -al $1 | cut -d" " -f1
for i in `cat temp`
do
perm= ls -l $i | cut -d" " -f1
if [ $permission -ne $perm ]
then n=`expr $n + 1`
fi
echo $n
done
and my statement which sounds like this:for an folder given as a parameter from keyboard i have to show how many files or sub-folder from inside the folder have different rights as the folder.this program it show the rights..but doesn't count nothing..plss help me