Linux Shell中的引号
来源:互联网 发布:地道战破解软件 编辑:程序博客网 时间:2024/05/03 20:48
Shell中引号分为三种:单引号、双引号和倒引号。
(1)双引号
由双引号括起来的字符,除$、倒引号(`Esc键下面的那个键)和反斜线(\)仍保留其特殊功能外,其余字符均作为普通字符对待。 “$"表示变量替换,即用其后指定的变量的值来代替$和变量;倒引号表示命令替换;仅当 “\"后面字符是下述字符之一时, “\"才是转义字符,这些字符是: "$" "`" " " " "\" 或换行符。转义字符告诉Shell不要对其后面的那个字符进行特殊处理,只是当作普通字符。例如:
$ echo "My current dir is `pwd` and logname is $LOGNAME"
My current dir is /home/test and logname is test
(2)单引号
由单引号括起来的字符都作为普通字符出现。例如:
$ echo 'The time is `date`, the file is $HOME/abc'
The time is `date`, the file is $HOME/abc
(3)倒引号
倒引号括起来的字符被shell解释为命令行,在执行时,Shell会先执行该命令行,并以它的标准输出结果取代整个倒引号部分。在前面示例中已经见过。例如:
$ echo current directory is `pwd`
current direcory is /home/test
本文出自:http://hi.baidu.com/shenliyu/item/ce149f2dba913e85ae48f501
- Linux Shell中的引号
- Linux Shell 中的反引号,单引号,双引号
- Linux Shell 中的反引号,单引号,双引号
- Linux Shell 中的反引号,单引号,双引号
- Linux Shell 中的反引号(`),单引号('),双引号 (")
- Linux Shell 中的反引号,单引号,双引号
- Linux Shell 中的反引号,单引号,双引号
- Linux Shell 中的反引号,单引号,双引号
- shell中的引号
- shell中的引号
- shell中的引号
- shell中的引号
- shell 中的引号
- Shell中的引号
- shell中的引号,单引号,反引号
- shell中的引号,单引号,反引号(转)
- Linux Shell 中的反引号,单引号,…
- Linux Shell 中的反引号,单引号,双引号的区别
- 模版
- Linux 之 shell 比较运算符
- mysql简单命令
- 第一个简单的cdev
- 取得正在运行的服务
- Linux Shell中的引号
- 取得所有运行程序
- hibernate从入门到精通
- OC运用考察
- 一个常规的链表排序
- linux下安装protobuf教程+示例(详细)
- jquery判断checkbox是否选中及改变checkbox状态
- C#.NET学习笔记1---C#.NET简介
- 取得手机的网络信息