免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 10452 | 回复: 12
打印 上一主题 下一主题

双引号前的$是什么意思 [复制链接]

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
1 [报告]
发表于 2005-09-08 14:15 |只看该作者

双引号前的$是什么意思

man bash, 找到 QUOTING 那段說明:

       Words of the form $'string' are treated specially.  The word expands to
       string,  with  backslash-escaped characters replaced as specifed by the
       ANSI C standard.  Backslash escape sequences, if present,  are  decoded
       as follows:
              \a     alert (bell)
              \b     backspace
              \e     an escape character
              \f     form feed
              \n     new line
              \r     carriage return
              \t     horizontal tab
              \v     vertical tab
              \\     backslash
              \'     single quote
              \nnn   the  eight-bit  character  whose value is the octal value
                     nnn (one to three digits)
              \xHH   the eight-bit character whose value  is  the  hexadecimal
                     value HH (one or two hex digits)
              \cx    a control-x character

       The  expanded  result  is  single-quoted, as if the dollar sign had not
       been present.

       A double-quoted string preceded by a dollar sign  ($)  will  cause  the
       string  to  be translated according to the current locale.  If the cur-
       rent locale is C or POSIX, the dollar sign is ignored.  If  the  string
       is translated and replaced, the replacement is double-quoted.

论坛徽章:
0
2 [报告]
发表于 2005-09-08 14:19 |只看该作者

双引号前的$是什么意思

原帖由 "網中人" 发表:
      A double-quoted string preceded by a dollar sign  ($)  will  cause  the
      string  to  be translated according to the current locale.  If the cur-
      rent locale is C or POSIX, the dollar sign is ignored.  If  the  string
      is translated and replaced, the replacement is double-quoted.


good job

看来也没有什么用!

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
3 [报告]
发表于 2005-09-08 14:21 |只看该作者

双引号前的$是什么意思

有用啊. 不是提到 locale 了嗎?

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
4 [报告]
发表于 2005-09-08 14:22 |只看该作者

双引号前的$是什么意思

嗯? 怎麼搞的, 我是回貼的人, 怎變了發貼的?

论坛徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亚冠之浦和红钻
日期:2015-06-23 19:10:532015亚冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16赛季CBA联赛之山东
日期:2016-01-31 18:25:0515-16赛季CBA联赛之四川
日期:2016-02-16 16:08:30程序设计版块每日发帖之星
日期:2016-06-29 06:20:002017金鸡报晓
日期:2017-01-10 15:19:5615-16赛季CBA联赛之佛山
日期:2017-02-27 20:41:19
5 [报告]
发表于 2005-09-08 14:23 |只看该作者

双引号前的$是什么意思

[quote]原帖由 "網中人"]嗯? 怎麼搞的, 我是回貼的人, 怎變了發貼的?[/quote 发表:

这叫粹取

论坛徽章:
0
6 [报告]
发表于 2005-09-08 15:17 |只看该作者

双引号前的$是什么意思

If the current locale is C or POSIX, the dollar sign is ignored.


  the  string     is translated and replaced, the replacement is double-quoted.

我想我会很快忘记的

论坛徽章:
0
7 [报告]
发表于 2005-09-08 16:17 |只看该作者

双引号前的$是什么意思

大侠~你理解的locale是什么意思啊?
能用中文解释下Me?

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
8 [报告]
发表于 2005-09-08 16:25 |只看该作者

双引号前的$是什么意思

簡單來說, 就是"當地語系", 比方 zh_CN, zh_TW.Big5 之類.
你可輸入 locale 命令查看語系設定.
你可用 export LC_ALL=xxxxxxxx 來改變語系設定值.
其中, LANG=xxxxxxxx 則需另設.

更多的, "找男人"跟"挖股溝"吧..........  ^_^

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
9 [报告]
发表于 2005-09-08 16:30 |只看该作者

双引号前的$是什么意思

试了几个locale,没感觉啥

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
10 [报告]
发表于 2005-09-08 16:32 |只看该作者

双引号前的$是什么意思

那在 X window 下測中日韓越幾種不同的"文字"看看?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP