Use cut
to redact IPs (BSD sed doesn't support backreferences)
This commit is contained in:
parent
d5b171a9ca
commit
d344d0ff16
9
nench.sh
9
nench.sh
@ -30,7 +30,14 @@ B_to_MiB()
|
||||
|
||||
redact_ip()
|
||||
{
|
||||
printf '%s\n' "$1" | sed 's!\(\([0-9a-f]\+[.:]\)\{3\}\).\+!\1xxxx!'
|
||||
case "$1" in
|
||||
*.*)
|
||||
printf '%s.xxxx\n' "$(printf '%s\n' "$1" | cut -d . -f 1-3)"
|
||||
;;
|
||||
*:*)
|
||||
printf '%s:xxxx\n' "$(printf '%s\n' "$1" | cut -d : -f 1-3)"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
finish()
|
||||
|
Loading…
x
Reference in New Issue
Block a user