8000 `jflex/bin/jflex` cannot resolves jar path. · Issue #251 · jflex-de/jflex · GitHub
[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jflex/bin/jflex cannot resolves jar path. #251

Closed
fono09 opened this issue Nov 9, 2017 · 2 comments
Closed

jflex/bin/jflex cannot resolves jar path. #251

fono09 opened this issue Nov 9, 2017 · 2 comments
Assignees
Labels
bug Not working as intended
Milestone

Comments

@fono09
Copy link
fono09 commented Nov 9, 2017

Cause

$ echo $LANG
ja_JP.UTF-8
$ type /bin/sh
/bin/sh は /bin/sh です

Finally, $PRG equals です.

Solution

Force LANG=C

$ LANG=C type /bin/sh
/bin/sh is /bin/sh

or use dirname, pwd to resolve path.

lsf37 added a commit that referenced this issue Nov 9, 2017
In some locales, `type $0` produces additional output, see issue #251.
@lsf37
Copy link
Member
lsf37 commented Nov 9, 2017

Interesting. I think I fixed the problem by using $0 directly instead of type $0. dirname and pwd aren't good enough, because they don't resolve symlinks (and readlink doesn't work properly on MacOS).

Would you be able to try out replacing the two lines

PRG=`type $0`
PRG=${PRG##* }

with just PRG="$0" in jflex/bin/jflex?

@lsf37 lsf37 self-assigned this Nov 10, 2017
@lsf37 lsf37 added the bug Not working as intended label Nov 10, 2017
@lsf37 lsf37 added this to the 1.7.0 milestone Nov 10, 2017
@fono09
Copy link
Author
fono09 commented Nov 12, 2017

It fixed. Thank you!

@fono09 fono09 closed this as completed Nov 12, 2017
lsf37 added a commit that referenced this issue Nov 12, 2017
In some locales, `type $0` produces additional output, see issue #251.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants
0