Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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
- #current folder
- f=$(pwd);
- #rename folder_name to folder_name.empty
- mv $f$i $f$i.empty;
- done;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement