samedi 9 mai 2015

Bash script does not sort by file type after IF

I need some help, guys. I have a bash code

#!/bin/bash
echo "Iveskite kataloga, kurio analize norite atlikti"
read katalogas
failai=$(find -x $katalogas)
for failas in $failai
do
if [[ -d "$failas" ]]
then 
   echo $failas " yra direktorija "
else
if [[ -x "$failas" ]]
then
echo $failas " yra vykdomasis failas "
else
if [[ -f "$failas" ]]
then
echo $failas " yra paprastasis failas "
fi
fi
fi
done

I want to make, that the final result would be sorted by file type. I do this: failai=$(find -x $katalogas) but It seems not working.

Aucun commentaire:

Enregistrer un commentaire