How to convert a string to lower case in Bash?

前端 未结 20 2046
慢半拍i
慢半拍i 2020-11-22 09:40

Is there a way in bash to convert a string into a lower case string?

For example, if I have:

a=\"Hi all\"

I want to convert it to:<

20条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 10:20

    In bash 4 you can use typeset

    Example:

    A="HELLO WORLD"
    typeset -l A=$A
    

提交回复
热议问题