shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cut variavel?


From: Davis Zanetti Cabral
Subject: cut variavel?
Date: Thu, 20 Feb 2003 09:06:45 -0300

Prezados,

Gostaria de saber como poderia ser feito para resgatar apenas 
o valor 351 analizando que ele pode ser desde o numero 1 
apenas até um numero de 3 digitos. Ex.: 252, 34, 99, 3, 7...
Atualmente estou utilizando:

cat /sc/events/evt.20$YEAR$MONTH$YESTERDAY* | pgrep "ALARM:35-
18091|ALARM:35-180
10" | grep "BTSSPAN" | cut -c13-35 | awk '{printf("%s %
s\n",substr($1,1,3),$3)}'
 > dadostmp

onde year, month e yesterday retornam a data de ontem, e o 
resto do comando pega o bloco que contem os alarmes e me 
retornam apenas o numero 351 abaixo.

    BTSPAN-351-1  03-02-18 22:54:11 omc MM-1 A000000.00000 
983854/798285
**  ALARM:35-18091 "SPAN OUT "
    DEVICE_SUBUNIT=1         REASON="None"

alguem poderia me ajudar nisso?

[]'s

Davis

 
---
UOL, o melhor da Internet
http://www.uol.com.br/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]