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.
-xflag to find before so I'm not sure what it's supposed to dofindlike that! What do you think will happen if there's a file with whitespace in its name?elifso you can avoidelse ifnesting like you're doing