Projet

Général

Profil

Révision ab554066

IDab554066192968363ce833bcf60c0d6ec9ecb14d
Parent 24d12be4
Enfant 71474809, fdbfa2c9

Ajouté par jolan78 il y a plus de 8 ans

dspam_ : fix parsing error when values are huge

Voir les différences:

plugins/dspam/dspam_
234 234

  
235 235
	debug starting $dspam_stats -t -S
236 236
	local t_start=$(date +%s)
237
	$dspam_stats -t -S | while read a b c d e f g h i j k l m x; do
238

  
237
	$dspam_stats -t -S | while IFS=' :' read a b c d e f g h i j k l m x; do
239 238
		# example of output format (3.9.1 rc1) for each user:
240 239
		#username@example.org
241 240
		#    TP:     0 TN:  2147 FP:     0 FN:    53 SC:     0 NC:     0
242 241
		#    SHR:    0.00%       HSR:    0.00%       OCA:   97.59%
243 242

  
244 243
		# or for short user names:
245
		#vmail    TP:  1141 TN:   459 FP:     0 FN:     5 SC:     0 NC:     0
244
		#vmail    TP:80312082 TN:198342928 FP: 82941 FN: 57326 SC: 0 NC: 3498
246 245
		#         SHR:   99.56%       HSR:    0.00%       OCA:   99.69%
247 246

  
248 247
		case $a in
249
			TP:)
248
			TP)
250 249
				# the 2nd line
251 250
				local tp=$b tn=$d fp=$f fn=$h sc=$j nc=$l
252 251
				;;
253
			SHR:)
252
			SHR)
254 253
				# the 3rd line
255 254
				local shr=$(echo $b | sed 's/%$//g')
256 255
				local hsr=$(echo $d | sed 's/%$//g')
......
267 266
				# the 1st line
268 267
				local uid=$a
269 268
				# data from 2nd line is also here
270
                                [ "$b" = "TP:" ] && local tp=$c tn=$e fp=$g fn=$i sc=$k nc=$m
269
                                [ "$b" = "TP" ] && local tp=$c tn=$e fp=$g fn=$i sc=$k nc=$m
271 270
				;;
272 271
		esac
273 272
	done

Formats disponibles : Unified diff