Search This Blog

Shell Script: upper case to lower case or vice versa

  • Uppercase to lowercase:

    echo $VAR | tr '[:upper:]' '[:lower:]'
    

    or

    echo $VAR | tr '[A-Z]' '[a-z]'
    

  • Lowercase to uppercase:

    echo $VAR | tr '[:lower:]' '[:upper:]'
    

    or

    echo $VAR | tr '[a-z]' '[A-Z]'
    

No comments:

Post a Comment