当前位置:网站首页>String splicing method in shell
String splicing method in shell
2022-07-03 08:53:00 【Xiaoping is extraordinary】
#!/bin/bash
name="Shell"
url="http://c.biancheng.net/shell/"
str1=$name$url # No spaces in between
str2="$name $url" # If surrounded by double quotes , Then there can be a space in the middle
str3=$name": "$url # Other strings can appear in the middle
str4="$name: $url" # It's OK to write like this
str5="${name}Script: ${url}index.html" # At this time, you need to add braces to the variable name
echo $str1
echo $str2
echo $str3
echo $str4
echo $str5
Running results :
Shellhttp://c.biancheng.net/shell/
Shell http://c.biancheng.net/shell/
Shell: http://c.biancheng.net/shell/
Shell: http://c.biancheng.net/shell/
ShellScript: http://c.biancheng.net/shell/index.html
边栏推荐
- 【Rust 笔记】11-实用特型
- 22-06-28 西安 redis(02) 持久化机制、入门使用、事务控制、主从复制机制
- [concurrent programming] Table hopping and blocking queue
- How to place the parameters of the controller in the view after encountering the input textarea tag in the TP framework
- [rust notes] 06 package and module
- [concurrent programming] thread foundation and sharing between threads
- 樹形DP AcWing 285. 沒有上司的舞會
- First Servlet
- On the difference and connection between find and select in TP5 framework
- 树形DP AcWing 285. 没有上司的舞会
猜你喜欢

Find the combination number acwing 885 Find the combination number I

Too many open files solution

Memory search acwing 901 skiing

JS non Boolean operation - learning notes

Dom4j traverses and updates XML

SQL statement error of common bug caused by Excel cell content that is not paid attention to for a long time

状态压缩DP AcWing 291. 蒙德里安的梦想

单调栈-84. 柱状图中最大的矩形

Unity editor expansion - scrolling list

树形DP AcWing 285. 没有上司的舞会
随机推荐
Drawing maze EasyX library with recursive backtracking method
分配异常的servlet
[concurrent programming] consistency hash
数位统计DP AcWing 338. 计数问题
Downward compatibility and upward compatibility
Annotations simplify configuration and loading at startup
【Rust 笔记】10-操作符重载
Unity editor expansion - the framework and context of unity imgui
Parameters of convolutional neural network
cres
【Rust 笔记】08-枚举与模式
How to delete CSDN after sending a wrong blog? How to operate quickly
请求参数的发送和接收
producer consumer problem
PHP mnemonic code full text 400 words to extract the first letter of each Chinese character
Divide candy (circular queue)
Six dimensional space (C language)
Gaussian elimination acwing 883 Gauss elimination for solving linear equations
[rust notes] 12 closure
Notes and bugs generated during the use of h:i:s and y-m-d