- 
      
 - 
        
Save eaybek/3655dbaa33c76bfff43f to your computer and use it in GitHub Desktop.  
    run command for all file in a folder 
  
        
  
    
      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 | |
| for f in $1/* | |
| do | |
| if [ -f "$f" ] | |
| then | |
| cmd=${2/__file__/$f} | |
| $cmd | |
| fi | |
| done | |
| #usage sample | |
| #fif ~/path/for/file "echo __file__" | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment