Skip to content

Instantly share code, notes, and snippets.

@johnpaulhayes
Created September 3, 2013 11:17
Show Gist options
  • Save johnpaulhayes/6422556 to your computer and use it in GitHub Desktop.
Save johnpaulhayes/6422556 to your computer and use it in GitHub Desktop.
Perform an action for each directory found in a given location
#! /bin/bash
# Description: For each directory in ~/Development, descend into it, pull the latest from git and come back out of it.
find ~/Development/. -type d -print0 -maxdepth 1 | while IFS= read -r -d '' dir
do
cd $dir
git pull
cd ../
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment