TP-systeme-exploitation-cen.../TP_Shell/verif/S4

12 lines
260 B
Plaintext
Raw Permalink Normal View History

2023-06-20 18:57:09 +00:00
if [ $1 = "-d" ]
then
list=`find $2 -type d -printf "%d %f\n"`
else
list=`find $1 -printf "%d %f\n"`
fi
while IFS= read -r line; do
nb=`echo $line | awk '{print $1}'`
printf '\t%.0s ' {0..$nb}
echo $line | awk '{print $2}'
done <<< "$list"