La coomande awk

Fermé
frip - 10 juin 2009 à 10:53
jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 - 10 juin 2009 à 11:53
Bonjour a tous
j'ai un pb et j'espere que vous pourrez m'aider, au faitt c'est toujours sur le traitement des fichiers , ma commande marche normalement mais mon seul souci est que le begin ne prend que l'instruction Print, hors j'aimerai pas afficher mais qu'il éxécute une commande me permettant de m'envoyer un mail si la condition est respectée .voici mon script

if [ -f $fic1 ]; then
awk 'BEGIN {
print ""
}
/^(RBS|RBS_BATCH|SYSTEM|TBSIND|TOOLS|USERS|TEMP)/ && $7 > 93 && $7 <= 97 {
#print "WARNING TABLESPACE "$1 ": BASE URQUAL %occupé "$VAL1
mailx -s WARNING frip@commentçamarche.fr < urqual1
}
' $fic1
fi.
Merci d'avance, jespere que j'ai été explicite

1 réponse

jipicy Messages postés 40842 Date d'inscription jeudi 28 août 2003 Statut Modérateur Dernière intervention 10 août 2020 4 897
10 juin 2009 à 11:53
Salut,

Essaie comme ça :
awk 'BEGIN {
print ""
}
/^(RBS|RBS_BATCH|SYSTEM|TBSIND|TOOLS|USERS|TEMP)/ && $7 > 93 && $7 <= 97 {
print "WARNING TABLESPACE "$1 ": BASE URQUAL %occupé "$VAL1 >> "urqual1"
}
END {
system( "mailx -s WARNING frip@commentçamarche.fr < urqual1" )
}
' $fic1 
0