
Estoy intentando encontrar la cantidad de archivos con permiso ejecutable del propietario. estoy haciendo esto pero me da error
cmd> ls -la /myScript.sh
myScript.sh es el siguiente
z=0
while read line
do
#for total lines read
#wc -l
#total unique user
#top three largest directory
#for total executables
for i in $(echo $line | sed -n '/^-rwx/p'| wc -l)
do
#echo $i #process in this if-then filter out 0 and sum non-zero
if [$i -ne 0]
then
echo $i
# $(z=z+i)
fi
done
done
echo "Total executable files by owner $z";
Respuesta1
Considere usar find
y wc
.
Lea sus manuales. Su script se puede hacer en una línea:
find . -type f -perm -u=x | wc -l