Instantly share code, notes, and snippets.

Embed
What would you like to do?
function loopdir {
command=$*
for d in */ ; do (cd $d; $command); done
}
function loopdirp { ## loop over directory based on a glob pattern loopdirp 'a*' rm deploy.yml
pattern=$1
shift 1
command=$*
for d in $pattern/ ; do (cd $d; $command); done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment