Cobra Forum

Other Discussion and Support => Education & Science => Topic started by: mahesh on Dec 18, 2023, 05:46 AM

Title: Script bash shell
Post by: mahesh on Dec 18, 2023, 05:46 AM
I need make an script to calculate the number of dirs and subdirs for separate


I make this but only calculate the sum of all

#!/bin/bash
find $1 -maxdepth 1 $TIPO | wc -l


TIPO=""
case $2 in
-d)TIPO1="-type d";;
-f)TIPO2="-type f";;
-b)TIPO3="-type f -o -type d"
esac






echo "hay" $TIPO1 "archivos tipo d"
echo "hay" $TIPO2 "archivos tipo f"
echo "hay" $TIPO3 "de d y f"