Created
December 18, 2016 00:04
-
-
Save Fusion/4870aba6217fd6fc209318bbf7f7e315 to your computer and use it in GitHub Desktop.
Recurse a shell command across 2 directories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function recurse() { | |
if [ "$#" -lt 3 ]; then | |
echo "Syntax: recurse dir1 dir2 commandline..."; | |
else | |
dir1="$1" | |
shift | |
dir2="$1" | |
shift | |
find $dir1 -type f -exec $@ {} $dir2/{} \; | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment