Skip to content

Instantly share code, notes, and snippets.

@FabienArcellier
Created August 16, 2016 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FabienArcellier/e9d857c381e3ca14ed004a564d8f11e8 to your computer and use it in GitHub Desktop.
Save FabienArcellier/e9d857c381e3ca14ed004a564d8f11e8 to your computer and use it in GitHub Desktop.
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