man find
- This command is used to search for files and/or subdirectories in a directory.
- In this script,
find
is used to search for immediate subdirectories matching the regular expressionR*.dm6
. The output offind
is a list of each match. These subdirectories are passed through a pipe into a push/pop loop.
- Wikipedia
- These commands are used to traverse directories using a stack structure.
- In this script, they are used to
cd
into each subdirectory (viapushd
) and return to the base directory (viapopd
). They are also modified to run quietly (no output).
${}
: variable subsitution${PWD##*/}
: basename ofpwd