#!/bin/bash

# nazwa pliku: filestat.sh

if [ $# -ne 1 ];

then

echo "Użycie $0 basepath";

exit

fi

path=$1

declare -A statarray;

while read line;

do

ftype=`file -b "$line" | cut -d, -f1`

let statarray["$ftype"]++;

done < <(find $path -type f -print)

echo ============ Typy plików i liczba ich wystąpień =============

for ftype in "${!statarray[@]}";

do

echo $ftype : ${statarray["$ftype"]}

done


18.&nbsp;&nbsp;&nbsp;&nbsp;

