how to output quotes in bash prompt
2015-04-04 17:22
393 查看
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
- How to access the features in an in-memory output layer using an IFeatureCursor
- [Linux cmd line] How to convert a binary file into output in C include file style.
- linux, how to define a new array in bash
- How to access the features in an in-memory output layer using an IFeatureCursor
- Bash tip: How to stop many processes in with a small script
- How to answer 'yes' in bash Script
- how to custom bash prompt
- how to view printf output in win32 app on visual studio 2010?
- [zz]How to produce html unit test output in Python?
- How to find and fix Bash Shell-shock vulnerability CVE-2014-6271 in unix like system
- [quote] How to comment multi-lines in bash shell script.
- how to generate an analog output from a in-built pwm of Atmega 32AVR microcontrloller?
- EF 接收OUTPUT参数的方法 How to Retrieve Stored Procedure Output Parameters in Entity Framework
- How to define a bash function for use in any script?
- How to change the output color of echo in Linux
- How to post quotes in cURL
- c++ - How to use wstring and wcout to output Chinese words in Xcode? - Stack Overflow
- How to Use the BASH "for" Loop in Shell Scripts
- How to define hash tables in bash?