Projet

Général

Profil

Révision f0015e24

IDf0015e24e4c39bb59b4c7038e8d487bcb72356ef
Parent 0ea6b7fa
Enfant 4e166aa9

Ajouté par Dennis Yusupoff il y a presque 14 ans

Light improvement in FreeBSD part of ps parsing

Voir les différences:

plugins/other/multimemory
37 37
  #%# capabilities=autoconf
38 38

  
39 39
=head1 VERSION
40

  
40
  0.3 light improvement in FreeBSD part of ps parsing
41 41
  0.2 second release, it should now work on machines without GNU sed
42 42
  0.1 first release, based on:
43 43
    multimemory.in 1590 2008-04-17 18:21:31Z matthias
......
91 91
	printf "$fieldname.value "
92 92

  
93 93
	if [ "$os" = "freebsd" ]; then
94
		ps auxww | grep -w $name | grep -v grep | sed -Ee 's/[ ]{1,}/ /g' | /usr/bin/cut -d ' ' -f 6 | /usr/bin/awk '{ total = total + $1 } END { print total * 1024 }'
94
		ps awxo rss,command | grep -w $name | grep -v grep | /usr/bin/awk '{ total += $1 } END { print total * 1024 }'
95 95
	else
96 96
		ps auxww | grep -w $name | grep -v grep | sed -re 's/[ ]{1,}/ /g' | /usr/bin/cut -d ' ' -f 6 | /usr/bin/awk '{ total = total + $1 } END { print total * 1024 }'
97 97
	fi

Formats disponibles : Unified diff