mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

This avoids swallowing multiple separate paths separated by unrelated content into one substitution, like here: orig_p=59856<...>/tcp] -> orig_p=59856/tcp, resp_h=192.150.187.43, resp_p=80/tcp]
12 lines
216 B
Bash
Executable file
12 lines
216 B
Bash
Executable file
#! /usr/bin/env bash
|
|
#
|
|
# Replace absolute paths with the basename.
|
|
|
|
if [ `uname` == "Linux" ]; then
|
|
sed="sed -r"
|
|
else
|
|
sed="sed -E"
|
|
fi
|
|
|
|
$sed 's#/+#/#g' | \
|
|
$sed 's#/([^\t :/]{1,}/){1,}([^\t :/]{1,})#<...>/\2#g'
|