当前位置:网站首页>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
边栏推荐
- Mortgage Calculator
- Sending and receiving of request parameters
- I made mistakes that junior programmers all over the world would make, and I also made mistakes that I shouldn't have made
- 单调栈-42. 接雨水
- Downward compatibility and upward compatibility
- 22-06-28 西安 redis(02) 持久化机制、入门使用、事务控制、主从复制机制
- PHP uses foreach to get a value in a two-dimensional associative array (with instances)
- [rust notes] 11 practical features
- Alibaba canaladmin deployment and canal cluster Ha Construction
- [redis] redis persistent RDB vs AOF (source code)
猜你喜欢
MySQL three logs
Campus lost and found platform based on SSM, source code, database script, project import and operation video tutorial, Thesis Writing Tutorial
Markdown learning
第一个Servlet
DOM 渲染系统(render mount patch)响应式系统
Format - C language project sub file
Dom4j traverses and updates XML
Concurrent programming (III) detailed explanation of synchronized keyword
求组合数 AcWing 885. 求组合数 I
树形DP AcWing 285. 没有上司的舞会
随机推荐
DOM render mount patch responsive system
Tree DP acwing 285 A dance without a boss
【Rust 笔记】12-闭包
Complex character + number pyramid
Final review of Database Principles
求组合数 AcWing 885. 求组合数 I
TP5 order multi condition sort
单调栈-42. 接雨水
请求参数的发送和接收
Monotonic stack -84 The largest rectangle in the histogram
MySQL three logs
Life cycle of Servlet
Gaussian elimination acwing 883 Gauss elimination for solving linear equations
Monotonic stack -42 Connect rainwater
分配异常的servlet
Deep parsing (picture and text) JVM garbage collector (II)
Memory search acwing 901 skiing
Unity interactive water ripple post-treatment
Find the intersection of line segments
Concurrent programming (III) detailed explanation of synchronized keyword