Fix remaining two code-review findings, both verified live: 30-selfdiag.sh regex-metachar breakage (g++), fx.sh dedup collision on ] in candidate text
This commit is contained in:
+8
-2
@@ -79,11 +79,17 @@ fx() {
|
||||
out=$("$src" "$cmd" 2>/dev/null)
|
||||
if [ -n "$out" ]; then
|
||||
printf '%s\n' "$out" | while IFS= read -r line; do
|
||||
[ -n "$line" ] && printf '[%s] %s\n' "$label" "$line"
|
||||
[ -n "$line" ] && printf '%s\t%s\n' "$label" "$line"
|
||||
done
|
||||
[ -n "$FX_AUTO" ] && break
|
||||
fi
|
||||
done | awk -F'] ' '!seen[$2]++'
|
||||
done | awk -F'\t' '
|
||||
{
|
||||
label = $1
|
||||
text = substr($0, length(label) + 2)
|
||||
if (!seen[text]++) print "[" label "] " text
|
||||
}
|
||||
'
|
||||
)
|
||||
|
||||
chosen=""
|
||||
|
||||
Reference in New Issue
Block a user