From: Willy Tarreau Date: Mon, 24 Jun 2024 09:05:08 +0000 (+0200) Subject: DEV: flags/show-fd-to-flags: adapt to recent versions X-Git-Tag: v3.1-dev2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a14c7d194ad27f9f84c9d42aab953a162999252a;p=thirdparty%2Fhaproxy.git DEV: flags/show-fd-to-flags: adapt to recent versions The script hadn't been updated since it was introduced, and the hard-coded field 12 doesn't match anymore (it's 16 now). Let's just use "grep -o cflg..." to extract the desired part more flexibly. This can be backported at least to 3.0, probably further, but it will need to be tested prior to this. Better not bring it too far, it's only used when debugging. --- diff --git a/dev/flags/show-fd-to-flags.sh b/dev/flags/show-fd-to-flags.sh index 29757c3204..2ee9e379bb 100755 --- a/dev/flags/show-fd-to-flags.sh +++ b/dev/flags/show-fd-to-flags.sh @@ -1,2 +1,2 @@ #!/bin/sh -awk '{print $12}' | grep cflg= | sort | uniq -c | sort -nr | while read a b; do c=${b##*=}; d=$(${0%/*}/flags conn $c);d=${d##*= }; printf "%6d %s %s\n" $a "$b" "$d";done +grep -o 'cflg=[0-9a-fx]*' | sort | uniq -c | sort -nr | while read a b; do c=${b##*=}; d=$(${0%/*}/flags conn $c);d=${d##*= }; printf "%6d %s %s\n" $a "$b" "$d";done