Bash substitute gives unexpected results (?)
Johnny Rosenberg
gurus.knugum at gmail.com
Sun Apr 5 07:43:10 UTC 2015
$ a="Black Sand Beach (ブラック・サンド・ビーチ)"; echo $a | sed 's/[^(|–]//g'
(
$
This is what I want. Everything except ”(” and ”–” (n-dash) should be
removed.
However, using pure Bash doesn't seem to work:
$ a="Black Sand Beach (ブラック・サンド・ビーチ)"; echo ${a//[^(|–]}
(ブラック・サンド・ビーチ
$
Why does Bash consider n-dash and some Japanese characters the same? :-O
Is there a setting I need to do somehow?
Kind regards
Johnny Rosenberg
ジョニー・ローゼンバーグ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20150405/26ee4674/attachment.html>
More information about the ubuntu-users
mailing list