Created
          November 5, 2015 04:47 
        
      - 
      
 - 
        
Save lcaballero/2980a882dbd895901d8c to your computer and use it in GitHub Desktop.  
    more bash loops
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/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