当前位置:网站首页>The difference between single quotation mark, double quotation mark and back quotation mark in shell script
The difference between single quotation mark, double quotation mark and back quotation mark in shell script
2022-04-23 06:48:00 【tilblackout】
When defining a variable , There can be no spaces on either side of the equal sign , If there are spaces, double quotation marks or single quotation marks can be used to combine the contents of variables .
(1) Special characters in double quotation marks can keep their original characteristics
var="lang is $LANG"
echo $var
-- Output --
lang is en_US
(2) Special characters in single quotation marks are only general text
var='lang is $LANG'
echo $var
-- Output --
lang is $LANG
- Special characters ( Include spaces ) Also available "\" Escape to general character
(3) The quotation marks : Some instructions require information from other instructions , You can use ` Instructions ` or $( Instructions ), The latter is recommended
version=`uname -r` or version=$(uname -r)
echo $version
-- Output --
5.4.0-77-generic
版权声明
本文为[tilblackout]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230549282630.html
边栏推荐
- 特效案例收集:鼠标星球小尾巴
- SQLite3 encrypted version
- HDU-Memory Control
- Shell脚本 &&和||的使用
- Error in created hook: “ReferenceError: “Promise”未定义“
- [UDS unified diagnosis service] i. diagnosis overview (3) - ISO 15765 architecture
- 浮点数双精度,单精度以及半精度知识总结
- C language advanced notes 3
- CUDA project encountered a series of compilation problems after changing the environment (computer)
- Krypton zeal
猜你喜欢
随机推荐
对象的动态建立和释放,赋值和复制
[UDS unified diagnosis service] i. diagnosis overview (3) - ISO 15765 architecture
软件工程中的十三种文档
QT add qserialport class to realize serial port operation
汇编 32位无符号加法计算器
[UDS unified diagnostic service] III. application layer protocol (1)
锚点定位——如何设置锚点居页面顶部距离,锚点定位并距离顶部一定偏移
sqlite3加密版
FOC 单电阻采样 位置环控制伺服电机
基于VGG卷积神经网络的图像识别代码实现
Incremental update of client software
微信小程序之 js 时间戳/1000 转换 秒,六个小时后,一天后,本周五 选项计算时间
20220222回归职场
进程管理命令
[ThreadX] ThreadX source code reading plan (I)
Modify registry values
2022ldu winter vacation training - program patch
C语言中volatile的使用
C语言进阶要点笔记4
TensorFlow张量介绍