LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 809|回复: 2

echo $"abc" 和echo "abc"的区别[已解决]

[复制链接]
发表于 2004-11-30 23:04:06 | 显示全部楼层 |阅读模式
在rh的/etc/rc.sysinit里面很常见的现象,就是在字符串前面加了$符号,e.g:
echo -en $"\t\tWelcome to "
action $"Configuring kernel parameters: " sysctl -e -p /etc/sysctl.conf
等等

why?
发表于 2004-12-1 08:48:44 | 显示全部楼层

回复: echo $"abc" 和echo "abc"的区别

最初由 biz 发表
在rh的/etc/rc.sysinit里面很常见的现象,就是在字符串前面加了$符号,e.g:
echo -en $"\t\tWelcome to "
action $"Configuring kernel parameters: " sysctl -e -p /etc/sysctl.conf
等等

why?


请看Bash的man手册的解释。
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.
 楼主| 发表于 2004-12-5 23:14:25 | 显示全部楼层
thx!

在rc.sysinit最前面加上LC_ALL=de_DE, 就看到效果了.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表