Created
          March 27, 2015 13:53 
        
      - 
      
- 
        Save etaf/1201e883bc2a6815ffe7 to your computer and use it in GitHub Desktop. 
    [bash] convert filename from lower case to upper case
  
        
  
    
      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 | |
| DIR="./leetcode" | |
| for file_name in `ls ./leetcode`; | |
| do | |
| new_file_name=`echo "$file_name" | tr '[:upper:]' '[:lower:]' ` | |
| if [ "$file_name"x != "$new_file_name"x ]; then | |
| echo "mv $DIR/$file_name $DIR/$new_file_name" | |
| `mv $DIR/$file_name $DIR/$new_file_name` | |
| fi | |
| done | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment