mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Merge aa-decode: use grep -E instead of egrep
egrep and fgrep are deprecated and will print a warning in the next grep release (3.8) https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1 MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/792 Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
commit
7711baae4a
1 changed files with 2 additions and 2 deletions
|
@ -37,7 +37,7 @@ EOM
|
|||
}
|
||||
|
||||
decode() {
|
||||
if echo "$1" | egrep -q "^[0-9A-Fa-f]+$" ; then
|
||||
if echo "$1" | grep -E -q "^[0-9A-Fa-f]+$" ; then
|
||||
python3 -c "import binascii; print(bytes.decode(binascii.unhexlify('$1'), errors='strict'));"
|
||||
else
|
||||
echo ""
|
||||
|
@ -53,7 +53,7 @@ fi
|
|||
# if have an argument, then use it, otherwise process stdin
|
||||
if [ -n "$1" ]; then
|
||||
e="$1"
|
||||
if ! echo "$e" | egrep -q "^[0-9A-Fa-f]+$" ; then
|
||||
if ! echo "$e" | grep -E -q "^[0-9A-Fa-f]+$" ; then
|
||||
echo "String should only contain hex characters (0-9, a-f, A-F)"
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue