<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2015-04-05 11:16 GMT+02:00 Nils Kassube <span dir="ltr"><<a href="mailto:kassube@gmx.net" target="_blank">kassube@gmx.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>Johnny Rosenberg wrote:<br>
> This is what I want. Everything except ”(” and ”–” (n-dash) should be<br>
> removed.<br>
> However, using pure Bash doesn't seem to work:<br>
><br>
> $ a="Black Sand Beach (ブラック・サンド・ビーチ)"; echo ${a//[^(|–]}<br>
> (ブラック・サンド・ビーチ<br>
> $<br>
> Why does Bash consider n-dash and some Japanese characters the same?<br>
<br>
</span>Maybe the three character encoding of your n-dash and the Japanese<br>
characters look similar enough to bash?<br>
<span><br>
> Is there a setting I need to do somehow?<br>
<br>
</span>It has something to do with your locale settings. If you try the same<br>
with the default locale, the result is different. So I think you should<br>
set one of the LC_* shell variables (probably LC_COLLATE) to Japanese<br>
and try your command again.<br></blockquote><div><br></div><div>Ok, the problem with that is that what's inside the parentheses isn't always Japanese. Sometimes it's English, sometimes it's Russian and there could be other languages as well. There could even be more than one language. Maybe the easiest way is to stay with sed after all, since it seems to work as expected.</div><div><br></div><div><br></div><div><div>Kind regards</div><div><br></div><div>Johnny Rosenberg</div><div>ジョニー・ローゼンバーグ</div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span><font color="#888888"><br>
<br>
Nils<br>
<br>
<br>
--<br>
ubuntu-users mailing list<br>
<a href="mailto:ubuntu-users@lists.ubuntu.com" target="_blank">ubuntu-users@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-users</a><br>
</font></span></blockquote></div><br></div></div>