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

Support BSD expr in startup script #11273

Closed
neirbowj opened this issue Jan 15, 2024 · 1 comment · Fixed by #11276
Closed

Support BSD expr in startup script #11273

neirbowj opened this issue Jan 15, 2024 · 1 comment · Fixed by #11276
Assignees

Comments

@neirbowj
Copy link

Jetty version(s)

All supported versions.

Enhancement Description

When the startup script reads the config file to detect XML files, it uses the expr command to skip comment lines. The only non-comment entry in the default config file starts with a hyphen. expr on Linux, macOS, and probably elsewhere, does not care.

$ expr "--module=pid,state" : "#"
0

expr on FreeBSD complains.

expr "--module=pid,state" : "#"
expr: illegal option -- -
expr: usage: expr [-e] expression

Both implementations recognize the use of "--" to signal the end of the command line options so that subsequent arguments that begin with a hyphen are not treated as options. This works on Linux and BSD:

$ expr -- "# comment" : "#"
1
$ expr -- "--module=pid,state" : "#"
0
@joakime
Copy link
Contributor

joakime commented Jan 16, 2024

Done, will be available in next releases of Jetty 10.0.20 / 11.0.20 / 12.0.6 (due at end of month)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants