Learning_the_bash_Shell_Third_Edition 6/n(chapter 4, page[117|99])

 

Length Operator(chapter 4, page[117|99])

There is one remaining operator on variables. It is ${#varname}, which returns the length of the value of the variable as a character string. (In Chapter 6, we will see how to treat this and similar values as actual numbers so they can be used in arithmetic expressions.) For example, if filename has the value alice.c, then ${#filename} would have the value 7.

 

posted @ 2021-03-03 11:08  碧水东流至此回  阅读(33)  评论(0编辑  收藏  举报