当前位置:网站首页>shell 字符串
shell 字符串
2022-07-19 21:54:00 【Ybc_Jame】
单引号
- 单引号里的任何字符都会原样输出,单引号字符串中的变量是无效的;
- 单引号字串中不能出现单独一个的单引号(对单引号使用转义符后也不行),但可成对出现,作为字符串拼接使用。
双引号
- 双引号里可以有变量
- 双引号里可以出现转义字符
yours="runoob"
strs="Hello,I know you are \"$yours\"!"
echo $strs
拼接字符(双引号、单引号)
//双引号
name="runoob"
string="hello,"$name"!"
string_2="hello,${name} !"
echo $string $string_2
//单引号
name="runoob"
string='hello,'$name'!'
string_2='hello,${name} !'
echo $string $string_2
获取字符串长度
string="abcd"
echo ${#string}
边栏推荐
- m基于光纤光栅传感网接入GPON的光纤通信系统matlab性能仿真,包括解码,解封装,分接,码率恢复,解帧,拆包,译码
- 我创建了clickhouse引擎,但是创建SQL节点以后,显示已解绑?这种情况是怎么回事
- Technology sharing | compile and install xtrabackup8 on domestic Kirin arm
- Take the first place in the International Olympic Games in mathematics, physics and chemistry, and win all the gold medals. Netizen: the Chinese team is too good
- 几种2022年流行的跨端技术方案的比较
- Compréhension approfondie du protocole TCP
- 银行ATM存取款系统(C语言实现)
- FileUploadBase$SizeLimitExceededException
- Typescript regular expression use
- 最新MATLAB下载安装教程(附文件)
猜你喜欢
[机缘参悟-47]:鬼谷子-第十一决篇-决策者,中庸也,利益合理化分配也
我的Notepad++插件推荐
Successfully solved @keyup Enter= "search()" problems that do not take effect in the El input component
MySQL transaction
趣店预制菜品牌战略发布会
"Pilot Cup" is coming! Summon the strongest brain in scientific computing, 360000 prize pool waiting for you!
The study of classic diagram of K-line diagram is conducive to correct
CPDA|先学数据分析工具还是数据分析思维?
Request method ‘POST‘ not supported。 Failed to load resource: net::ERR_FAILED
“先导杯”来啦!召唤科学计算界的最强大脑,36万奖池等你来拿!
随机推荐
leetcode:632. 最小区间
超越Transformer,清华、字节大幅刷新并行文本生成SoTA性能|ICML 2022
华为无线设备漫游配置同一业务VLAN的AP间非快速漫游
leetcode:632. Minimum interval
包揽数理化国际奥赛全部第一,全员金牌,网友:中国队太秀了
Unity_ Memory optimization for multiple colors of the same material - use materialpropertyblock
Assertion and named group and deconstruction before and after typescript regularity
什么是Nacos及实战使用教程
Knowledge and location theory of golden K-line diagram
Particle dissipation of unity 3D characters
Notepad++的第三方插件介绍中文翻译
佣金最低的证券交易所是哪家?网上客户经理开户安全吗
1053 Path of Equal Weight
Unity 3D人物的粒子消散
Super easy to use screenshot software snipaste (including installation package), how to set snipaste to start automatically
Typescript regular expression use
leetcode:952. 按公因数计算最大组件大小
基于BIO模式下通信项目
趣店预制菜品牌战略发布会
【Matlab】解决使用Mex 报错There was a problem creating the mex file for Real Time Execution ,Please ensure y