Skip to content

Commit 715cce9

Browse files
committed
Remove 'egrep' and use 'grep -E' instead.
The command 'egrep' (and 'fgrep') has been deprecated since 2007. GNU egrep 3.8+ now prints a warning that 'egrep' is deprecated and this warning appears in the gvm command output. It has been over 14 years since 'egrep' and 'fgrep' were deprecated and it's time to stop using them. Furthermore, POSIX does not even include an 'egrep' or 'fgrep' command, only 'grep'.
1 parent dd65253 commit 715cce9

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

scripts/function/gvm_export_path

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
function gvm_export_path() {
3-
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/:*$//')"
3+
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/:*$//')"
44
export GVM_PATH_BACKUP="$PATH"
55
}
66

scripts/function/tools

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ LS_ERROR="GVM couldn't find ls"
33
TR_ERROR="GVM couldn't find tr"
44
SED_ERROR="GVM couldn't find sed"
55
GREP_ERROR="GVM couldn't find grep"
6-
EGREP_ERROR="GVM couldn't find egrep"
76
SORT_ERROR="GVM couldn't find sort"
87
HEAD_ERROR="GVM couldn't find head"
98
HEXDUMP_ERROR="GVM couldn't find hexdump"
@@ -12,7 +11,6 @@ LS_PATH=$(unalias ls &> /dev/null; command -v ls) || display_error "$LS_ERROR" |
1211
TR_PATH=$(unalias tr &> /dev/null; command -v tr) || display_error "$TR_ERROR" || return 1
1312
SED_PATH=$(unalias sed &> /dev/null; command -v sed) || display_error "$SED_ERROR" || return 1
1413
GREP_PATH=$(unalias grep &> /dev/null; command -v grep) || display_error "$GREP_ERROR" || return 1
15-
EGREP_PATH=$(unalias egrep &> /dev/null; command -v egrep) || display_error "$EGREP_ERROR" || return 1
1614
SORT_PATH=$(unalias sort &> /dev/null; command -v sort) || display_error "$SORT_ERROR" || return 1
1715
HEAD_PATH=$(unalias head &> /dev/null; command -v head) || display_error "$HEAD_ERROR" || return 1
1816
HEXDUMP_PATH=$(unalias hexdump &> /dev/null; command -v hexdump) || display_error "$HEXDUMP_ERROR" || return 1

0 commit comments

Comments
 (0)