How can I understand this syntax a bit better?
find ~/Documents/project/updates -type d -name "Branch*[0-9]" -maxdepth 1 -mtime -2 -print |\
while read path; do
dir_name=$(basename $path)
function_call $dir_name
done
Generate list of directories with find
~/Documents/project/updates
look for directories under this path-type d
look only for "directories" (and not files, inodes, or other file types)-name "Branch*[0-9]"
look only for directories whose names match this wildcardmaxdepth 1
don't look any lower than one level deep-mtime -2
modification time -2 daysNow that we have a list, for each item in that list,
dir_name=$(basename $path)
Set "dir_name" to the basename of the directoryfunction_call $dir_name
Call "function_call" with "$dir_name"STRONG SUGGESTION:
Temporarily add set -xv
to the top of your shell script and observe the results :)