Skip to content

Instantly share code, notes, and snippets.

@lcaballero
Created November 5, 2015 04:47
Show Gist options
  • Save lcaballero/2980a882dbd895901d8c to your computer and use it in GitHub Desktop.
Save lcaballero/2980a882dbd895901d8c to your computer and use it in GitHub Desktop.
more bash loops
#!/bin/bash
function clean() {
rm -rf a b c
}
function _a() {
mkdir a
}
function _b() {
mkdir b
}
function _c() {
mkdir c
}
function all() {
dirs=( _a _b _c )
for p in "${dirs[@]}"; do
echo "$p"
$p
done
}
$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment