Skip to content

Instantly share code, notes, and snippets.

@dpritchett
Created May 10, 2011 21:35
Show Gist options
  • Save dpritchett/965432 to your computer and use it in GitHub Desktop.
Save dpritchett/965432 to your computer and use it in GitHub Desktop.
simple use of xargs to streamline a series of mkdir ops
mkdir playground
mkdir playground/src
mkdir playground/classes
echo playground playground/src playground/classes | xargs mkdir
# mkdir: cannot create directory `playground': File exists
# mkdir: cannot create directory `playground/src': File exists
# mkdir: cannot create directory `playground/classes': File exists
# Bonus points for DRYing the "playground" part...?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment