机器人 救救瓜
Toggle navigation
Home
SCM-tool
Linux
Jenkins
SVN
other
About Me
Archives
Tags
shell 字符串长度
? shell ?
2019-09-10 15:18:37
402
0
0
gua_l
? shell ?
</br> </br> #### 包含行首尾的空格 ``` echo ${#Massage} ``` #### 不包含行首尾的空格 ``` echo $Massage | awk '{print length($0)}' ``` </br> #### 示例 ``` [lcf@huangbei ~]$ Massage=" Usage: $0 \${RELEASE_NOTE_FULL_PATH} " [lcf@huangbei ~]$ echo ${#Massage} 39 [lcf@huangbei ~]$ echo $Massage | awk '{print length($0)}' 37 ``` ``` [lcf@huangbei ~]$ Massage="Usage: $0 \${RELEASE_NOTE_FULL_PATH}" [lcf@huangbei ~]$ echo ${#Massage} 37 ```
Pre:
Linux Shell 处理 json 对象 (分解 gitlab API 返回的json 对象)-- jq
Next:
Gitlab 新手入门
0
likes
402
Weibo
Wechat
Tencent Weibo
QQ Zone
RenRen
Submit
Sign in
to leave a comment.
No Leanote account?
Sign up now.
0
comments
More...
Table of content
No Leanote account? Sign up now.