This don't work for me.
#!/bin/bash
# script to find empty folder in current folder and rename it.
#find empty folder and write it into fef.txt
find . -type d -empty -maxdepth 1 -mindepth 1 | cut -c2- > fef.txt;
#number line of fef.txt
nl_fef=$(cat fef.txt | wc -l);
#rename loop
for i in {1..$nl_fef};
do
# folder path
f=$(pwd);
d=$(cat fef.txt | head -$i | tail -1)
folder_path=$f$d
#rename folder_name to folder_name.empty
mv "$folder_path" "$folder_path".empty;
done;
This is output:
find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
find: warning: you have specified the -mindepth option after a non-option argument -type, but options are not positional (-mindepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
head: invalid option -- '{'
Try 'head --help' for more information.