how to output quotes in bash prompt
introduction
In certain situations, quotes are required to be output in the command prompt. To do this, you may say why don’t use single quotes. Basically, that is able to handle most cases. However, single quotes prevent parsing environment variables. In this blog, we present a simple way to handle outputing quotes while parsing specifiled environment variables.
the method
Firstly, we use single quotes:
echo 'hello "margin"'
the output showing below:
hello “margin”
Try to display environment variables:
echo '"hello $PATH"'
outputs
“hello $PATH”
If we prefer the content of PATH!
echo '"'hello $PATH'"'
result is :
“hello /usr/sbin:/usr/bin:/sbin:/bin”
Pay your attention on the first 3 characters after echo, and the last 3 characters! They are ', ", '!!!!
Do I make sense? Have any question? Do not hesitate to ask me~
how to output quotes in bash prompt的更多相关文章
- bash shell命令行选项与修传入参数处理
在编写shell程序时经常需要处理命令行参数,本文描述在bash下的命令行处理方式.选项与参数:如下命令行: ./test.sh -f config.conf -v --prefix=/home -f ...
- 【转】Bash Shell中命令行选项/参数处理
原文网址:http://www.cnblogs.com/FrankTan/archive/2010/03/01/1634516.html 0.引言 写程序的时候经常要处理命令行参数,本文描述在Bash ...
- Bash Shell中命令行选项/参数处理
0.引言 写程序的时候经常要处理命令行参数,本文描述在Bash下的命令行处理方式. 选项与参数: 如下一个命令行: ./test.sh -f config.conf -v --prefix=/home ...
- 脚本乐园 Shell中命令行选项和参数的处理
在Linux的Shell中怎样处理tail -n 10 access.log这样的命令行选项呢?这是被别人问起的一个问题,好好学习了一下,进行总结如下:在bash中,可以用以下三种方式来处理命令行参数 ...
- [记录]Shell中的getopts和getopt用法
Shell中的getopts和getopt用法 1.getopts getopts(shell内置命令)不能直接处理长的选项(如:--prefix=/home等),getopts有两个参数,第一个参数 ...
- Shell script 传参数处理(默认变量)
变量 含义 $0:shell脚本的名字: $1 位置参数 #1 $2 - $9 位置参数 #2 - #9 ${10} 位置参数 #10 "$*" :代表"$1c$2c$3 ...
- getopts的使用
getopts的使用 语法格式:getopts [option[:]] [DESCPRITION] VARIABLE option:表示为某个脚本可以使用的选项 ":":如果某个选 ...
- Shell 参数(2) --解析命令行参数工具:getopts/getopt
getopt 与 getopts 都是 Bash 中用来获取与分析命令行参数的工具,常用在 Shell 脚本中被用来分析脚本参数. 两者的比较 (1)getopts 是 Shell 内建命令,geto ...
- shell脚本读取命令行的参数
转至:https://www.cnblogs.com/eternityz/p/13879836.html 前提 在编写shell程序时经常需要处理命令行参数 选项与参数: 如下命令行: ./test. ...
随机推荐
- Git reset到某一次commit
下图场景:张三和李四并行开发,张三提交commit1(bc2dd00),李四提交commit2(7f019d2),张三再提交commit3(44d4fc5),如果此时李四revert commit2, ...
- 深入理解Redux
前面的话 Redux是Flux思想的另一种实现方式.Flux是和React同时面世的.React用来替代jQuery,Flux用来替换Backbone.js等MVC框架.在MVC的世界里,React相 ...
- FTP方式发布webservice
以前我发布webservice的步骤是:在 C:\inetpub\wwwroot\路径下发布webservice,然后再在IIS中添加网站并制定路径,这样每次发布了webservice后,需要把发布 ...
- [LeetCode] Course Schedule III 课程清单之三
There are n different online courses numbered from 1 to n. Each course has some duration(course leng ...
- 我们为什么要用springcloud?
1 2 单体架构 在网站开发的前期,项目面临的流量相对较少,单一应用可以实现我们所需要的功能,从而减少开发.部署和维护的难度.这种用于简单的增删改查的数据访问框架(ORM)十分的重要. 垂直应用架构 ...
- Mysql中的常用函数:
Mysql中的常用函数: 1.字符串函数: (1).合并字符串 concat():// concat('M','y',"SQL",'5.5');== MySQL5.5//当传入的参 ...
- [SDOI 2010]魔法猪学院
Description 题库链接 给出一张 \(n\) 个点 \(m\) 条边有向图,询问最多有多少条不同的路径从 \(1\) 到 \(n\) 并且路径长度和 \(\leq E\) . \(2\leq ...
- Evensgn 的债务
问题 A: Evensgn 的债务 大致题意:a欠b5元,b欠c5元,那么最小债务总额为a欠c5元,给你关系,求最小债务总额! 不想说话...一句超级大水题,我居然没读懂!!差点想到网络流了...其实 ...
- hihocoder 1388 fft循环矩阵
#1388 : Periodic Signal 时间限制:5000ms 单点时限:5000ms 内存限制:256MB 描述 Profess X is an expert in signal proce ...
- hdu 5739 割点
Fantasia Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total S ...