Skip to content

Commit

Permalink
Replaces egrep with grep -E in gvm_export_path function
Browse files Browse the repository at this point in the history
`egrep` is listed as deprecated and in Fedora 38, is outputting the message "warnin: egrep is obsolescent". According to moovweb#431, the official release notes from Grep 3.8 state egrep has been deprecated since 2007.

This PR replaces `egrep` in gvm_export_path with `grep -E`.

`egrep` is mentioned in a couple of the files in `./examples/native/`, but as I don't think they're critical to the use of GVM, I have not attempted to replace them.

Fixes moovweb#431

Signed-off-by: Chris Collins <collins.christopher@gmail.com>
  • Loading branch information
clcollins committed Sep 20, 2023
1 parent dd65253 commit d9b2e74
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/function/gvm_export_path
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
function gvm_export_path() {
export PATH="$GVM_ROOT/bin:$(echo "$PATH" | $TR_PATH ":" "\n" | "$GREP_PATH" -v '^$' | $EGREP_PATH -v "$GVM_ROOT/(pkgsets|gos|bin)" | $TR_PATH "\n" ":" | $SED_PATH 's/:*$//')"
export PATH="$GVM_ROOT/bin:$(echo "$PATH" | $TR_PATH ":" "\n" | "$GREP_PATH" -v '^$' | "$GREP_PATH" -E -v "$GVM_ROOT/(pkgsets|gos|bin)" | $TR_PATH "\n" ":" | $SED_PATH 's/:*$//')"
export GVM_PATH_BACKUP="$PATH"
}

1 change: 0 additions & 1 deletion scripts/function/tools
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ LS_PATH=$(unalias ls &> /dev/null; command -v ls) || display_error "$LS_ERROR" |
TR_PATH=$(unalias tr &> /dev/null; command -v tr) || display_error "$TR_ERROR" || return 1
SED_PATH=$(unalias sed &> /dev/null; command -v sed) || display_error "$SED_ERROR" || return 1
GREP_PATH=$(unalias grep &> /dev/null; command -v grep) || display_error "$GREP_ERROR" || return 1
EGREP_PATH=$(unalias egrep &> /dev/null; command -v egrep) || display_error "$EGREP_ERROR" || return 1
SORT_PATH=$(unalias sort &> /dev/null; command -v sort) || display_error "$SORT_ERROR" || return 1
HEAD_PATH=$(unalias head &> /dev/null; command -v head) || display_error "$HEAD_ERROR" || return 1
HEXDUMP_PATH=$(unalias hexdump &> /dev/null; command -v hexdump) || display_error "$HEXDUMP_ERROR" || return 1

0 comments on commit d9b2e74

Please sign in to comment.