[opensuse] simple bash unicode / octal encoding question
I'm running bash. I'm trying to access a file explicitly that has a unicode char in the name:
ls *mynd.dd | od -c 0000000 i 314 201 m y n d . d d \n 0000013
Naively just trying to put those as octal chars isn't working:
ls i\0314\0201mynd.dd ls: cannot access i03140201mynd.dd: No such file or directory
I believe \0314\0201 is actually a single unicode char. What is the right syntax? Thanks Greg -- Greg Freemyer www.IntelligentAvatar.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Thu, 2 Jul 2015 11:23:34 -0400 Greg Freemyer <greg.freemyer@gmail.com> пишет:
I'm running bash.
I'm trying to access a file explicitly that has a unicode char in the name:
ls *mynd.dd | od -c 0000000 i 314 201 m y n d . d d \n 0000013
Naively just trying to put those as octal chars isn't working:
ls i\0314\0201mynd.dd ls: cannot access i03140201mynd.dd: No such file or directory
I believe \0314\0201 is actually a single unicode char.
What is the right syntax?
Try ls i$'\314'$'\201'mynd.dd -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Thu, Jul 2, 2015 at 12:23 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
В Thu, 2 Jul 2015 11:23:34 -0400 Greg Freemyer <greg.freemyer@gmail.com> пишет:
I'm running bash.
I'm trying to access a file explicitly that has a unicode char in the name:
ls *mynd.dd | od -c 0000000 i 314 201 m y n d . d d \n 0000013
Naively just trying to put those as octal chars isn't working:
ls i\0314\0201mynd.dd ls: cannot access i03140201mynd.dd: No such file or directory
I believe \0314\0201 is actually a single unicode char.
What is the right syntax?
Try
ls i$'\314'$'\201'mynd.dd
Perfection. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 7/2/2015 12:27 PM, Greg Freemyer wrote:
Try
ls i$'\314'$'\201'mynd.dd Perfection.
You could also use the unicode 'code' point:
echo "i\u0308mynd.dd"|od -c 0000000 i 314 210 m y n d . d d \n
assuming your locale settings have UTF-8 in them: LC_CTYPE=en_US.UTF-8 If you have 'C' or POSIX encoding, won't work:
LC_ALL=C echo "i\u0308mynd.dd"|od -c 0000000 m y n d . d d \n 0000010 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (3)
-
Andrei Borzenkov
-
Greg Freemyer
-
Linda Walsh