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

Comments

Projects
None yet
2 participants
@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

Avoid `type $0`, use `$0` directly.
In some locales, `type $0` produces additional output, see issue #251.
@lsf37

This comment has been minimized.

Show comment
Hide comment
@lsf37

lsf37 Nov 9, 2017

Member

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?

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 label Nov 10, 2017

@lsf37 lsf37 added this to the 1.7.0 milestone Nov 10, 2017

@fono09

This comment has been minimized.

Show comment
Hide comment
@fono09

fono09 Nov 12, 2017

It fixed. Thank you!

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

Avoid `type $0`, use `$0` directly.
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