|
Publicité ' | |||||||||||||||||||||||
|
|
#1 | ||
|
Membre habitué
![]() Inscription : mars 2006 Messages : 413 ![]() |
Bonjour,
perso j'ai une probleme et je ne trouve pas la solution, hum, quand jexecute un script, il lance la commande free -m, puis il utilise la commande awk pour récupérer ce que je veux, disons ici la mémoire total, mais sur ce script mon echo ne fonctionne pas oO Code :
idem avec $free_mem=$2, ca marche pas ! Quelqu'un a une idée? Merki
__________________
=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-= (\_/) (O.o) (> <) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!! =-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-= |
||
|
|
00
|
|
|
#2 |
|
Membre Expert
![]() Frédéric Brugmans Informaticien multitâche Inscription : février 2005 Messages : 661 ![]() |
tableau=( $( free -m |awk ' /Mem:/ { gsub("Mem:[^0-9]*","") ; print $0 } ' ) )
echo ${tableau[0]} |
|
|
00
|
|
|
#3 |
|
Membre habitué
![]() Inscription : mars 2006 Messages : 413 ![]() |
wahou, c'est du script ca ^^, je connaissais pas gsub tiens, je vais m'informer, merci bcp !
__________________
=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-= (\_/) (O.o) (> <) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!! =-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-= |
|
|
00
|
Copyright © 2000-2012 - www.developpez.com