Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to quickly realize upper and lower in shell

Shulou Source: shulou.com Published: 2022-06-01 03:20:24 10月25日 Update

In this issue, the editor will bring you about how to quickly achieve upper and lower in shell. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

UPPERCASE:

[root@datanode-32 test] # echo "abc123" | tr'[Amurz]'[Amurz]'

Results: ABC123

LOWERCASE:

[root@datanode-32 test] # echo "XAC123" | tr'[Amurz]'[Amurz]'

Results: xac123

In the script:

UPPERCASE=$ (echo $VARIABLE | tr'[Amurz]'[Amurz]') (convert lowercase to uppercase of VARIABLE)

LOWERCASE=$ (echo $VARIABLE | tr'[Amurz]'[Amurz]') (convert uppercase to lowercase of VARIABLE)

This is how to quickly implement upper and lower in the shell shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Tags: Content uppercase lowercase results analysis professional small and medium rich in content that is articles more knowledge articles scripts industry perspective information information channels channels related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Apple Huawei MariaDB Microsoft