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
Milestone

Comments

@fono09
Copy link

@fono09 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 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 label Nov 10, 2017
@lsf37 lsf37 added this to the 1.7.0 milestone Nov 10, 2017
@fono09
Copy link
Author

@fono09 fono09 commented Nov 12, 2017

It fixed. Thank you!

@fono09 fono09 closed this 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.