register fails when egrep doesn't support -a #549

Closed
opened 2025-12-29 01:27:06 +01:00 by adam · 4 comments
Owner

Originally created by @bahamat on GitHub (Sep 21, 2021).

The detection for which grep to use doesn't take into account that -a is not always supported, which leads to it not setting GREP=awk_egrep.

# ./dehydrated --register --accept-terms
# INFO: Using main config file /opt/dehydrated/config
egrep: illegal option -- a
usage: egrep [-bchHilLnoqrRsvx] [-A num] [-B num] [-C num|-num]
             [--label=name] [-e pattern_list]... [-f pattern_file]...
             [pattern_list] [file]...
EXPECTED value GOT EOF

Additionally, systems where egrep doesn't support -a, probably won't have gawk. But even if they do, gawk produces this error:

gawk: cmd. line:3: (FILENAME=- FNR=1) warning: regexp escape sequence `\u' is not a known regexp operator

or

gawk: cmd. line:3: (FILENAME=- FNR=1) fatal: Invalid range end: /"[^[:cntrl:]"\]*((\[^u[:cntrl:]]|\u[0-9a-fA-F]{4})[^[:cntrl:]"\]*)*"|-?(0|[1-9][0-9]*)([.][0-9]*)?([eE][+-]?[0-9]*)?|null|false|true|[[:space:]]+|./

(depending on version).

Originally created by @bahamat on GitHub (Sep 21, 2021). The detection for which grep to use doesn't take into account that -a is not always supported, which leads to it not setting `GREP=awk_egrep`. ``` # ./dehydrated --register --accept-terms # INFO: Using main config file /opt/dehydrated/config egrep: illegal option -- a usage: egrep [-bchHilLnoqrRsvx] [-A num] [-B num] [-C num|-num] [--label=name] [-e pattern_list]... [-f pattern_file]... [pattern_list] [file]... EXPECTED value GOT EOF ``` Additionally, systems where egrep doesn't support `-a`, probably won't have `gawk`. But even if they do, gawk produces this error: ``` gawk: cmd. line:3: (FILENAME=- FNR=1) warning: regexp escape sequence `\u' is not a known regexp operator ``` or ``` gawk: cmd. line:3: (FILENAME=- FNR=1) fatal: Invalid range end: /"[^[:cntrl:]"\]*((\[^u[:cntrl:]]|\u[0-9a-fA-F]{4})[^[:cntrl:]"\]*)*"|-?(0|[1-9][0-9]*)([.][0-9]*)?([eE][+-]?[0-9]*)?|null|false|true|[[:space:]]+|./ ``` (depending on version).
adam closed this issue 2025-12-29 01:27:06 +01:00
Author
Owner

@lukas2511 commented on GitHub (Sep 21, 2021):

Hey, thanks for the input. I actually have a version of dehydrated lurking on my system (for waaay to long..) that got rid of the egrep and gawk usage completely, but I didn't push it yet because I was kinda stuck on setting up a testing system, which I wanted to do before pushing code that could have broken dehydrated on various systems...

I've uploaded that version here (for now): https://gist.github.com/lukas2511/5baa4fd9358f5fa622b90f3cfb2c0a19

It would be great if you could check if it works for you.

@lukas2511 commented on GitHub (Sep 21, 2021): Hey, thanks for the input. I actually have a version of dehydrated lurking on my system (for waaay to long..) that got rid of the egrep and gawk usage completely, but I didn't push it yet because I was kinda stuck on setting up a testing system, which I wanted to do before pushing code that could have broken dehydrated on various systems... I've uploaded that version here (for now): https://gist.github.com/lukas2511/5baa4fd9358f5fa622b90f3cfb2c0a19 It would be great if you could check if it works for you.
Author
Owner

@bahamat commented on GitHub (Sep 21, 2021):

I'll try that one and let you know.

@bahamat commented on GitHub (Sep 21, 2021): I'll try that one and let you know.
Author
Owner

@bahamat commented on GitHub (Sep 21, 2021):

Nope, that one doesn't. I got here originally because on illumos, our grep doesn't support -a, and that's the error I still get. here.

# ./dehydrated --register --accept-terms
# INFO: Using main config file /opt/dehydrated/config
grep: illegal option -- a
usage:  grep [-E|-F] [-bchHilLnoqrRsvx] [-A num] [-B num] [-C num|-num]
             [--label=name] [-e pattern_list]... [-f pattern_file]...
             [pattern_list] [file]...
EXPECTED value GOT EOF
@bahamat commented on GitHub (Sep 21, 2021): Nope, that one doesn't. I got here originally because on illumos, our grep doesn't support `-a`, and that's the error I still get. here. ``` # ./dehydrated --register --accept-terms # INFO: Using main config file /opt/dehydrated/config grep: illegal option -- a usage: grep [-E|-F] [-bchHilLnoqrRsvx] [-A num] [-B num] [-C num|-num] [--label=name] [-e pattern_list]... [-f pattern_file]... [pattern_list] [file]... EXPECTED value GOT EOF ```
Author
Owner

@lukas2511 commented on GitHub (Oct 31, 2021):

Should hopefully be fixed by the merged pull-request (#840).

@lukas2511 commented on GitHub (Oct 31, 2021): Should hopefully be fixed by the merged pull-request (#840).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#549