Trying to run a script that will fetch all directories, and files containing these directories, and logs data onto a .CSV file.
So, if I were to have structure like: mainDir.dir -> [sub1.dir -> file01.png, sub2.dir -> file02.png] , I would get a CSV of
- dir; file
- sub1; file01.png
- sub2; file02.png
This is the script I currently have
for dir in */ .*/ ;
do
for entry in $dir
do
path="$entry"
empty=""
file="${$dir/$empty}"
echo -e "$dir;$file;" >> file.csv
done
done
ls -AR
?find
?