Chinaunix首页 | 论坛 | 博客
  • 博客访问: 116905
  • 博文数量: 73
  • 博客积分: 66
  • 博客等级: 民兵
  • 技术积分: 497
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-22 14:59
文章分类

全部博文(73)

文章存档

2015年(65)

2013年(5)

2012年(3)

我的朋友

分类: LINUX

2015-02-09 14:01:30



If you need to suppress all expansions, you use single quotes. Here is a comparison of unquoted, double quotes, and single quotes:

[me@linuxbox me]$ echo text ~/*.txt {a,b} $(echo foo) $((2+2)) $USER
text /home/me/ls-output.txt a b foo 4 me
[me@linuxbox me]$ echo "text ~/*.txt {a,b} $(echo foo) $((2+2)) $USER"
text ~/*.txt {a,b} foo 4 me
[me@linuxbox me]$ echo 'text ~/*.txt {a,b} $(echo foo) $((2+2)) $USER'
text ~/*.txt {a,b} $(echo foo) $((2+2)) $USER

As you can see, with each succeeding level of quoting, more and more of the expansions are suppressed.

阅读(504) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~