Skip to content

Commit d5c8676

Browse files
wtarreaucapflam
authored andcommitted
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. (cherry picked from commit a14c7d1) Signed-off-by: Christopher Faulet <[email protected]>
1 parent 078cb85 commit d5c8676

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dev/flags/show-fd-to-flags.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/sh
2-
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
2+
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

0 commit comments

Comments
 (0)