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

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

Re: [shell-script] [ expr ] - Saída do AWK


From: atallef ¡! ɟǝllɐʇɐ
Subject: Re: [shell-script] [ expr ] - Saída do AWK
Date: Thu, 11 Sep 2014 16:01:33 -0300

Multiplicar direto pelo awk?

ls -l | grep firefox-32.0.tar.bz2.1 | awk '{print $5 * 8}'

2014-09-11 15:57 GMT-03:00 Flavio Steimacher address@hidden [shell-script] <address@hidden>:
 

uma opção é utilizar um shift binário, deslocando 3 bits para multiplicar por 8:
echo $(( $(ls -l | grep mongotest.js | awk '{print $5}') << 3 ))


Em 11 de setembro de 2014 15:50, Gustavo Filgueiras address@hidden [shell-script] <address@hidden> escreveu:
 

Caros, boa tarde !

    Estou tentando pegar o número de bits de um arquivo, mas não estou conseguindo jogar a saida do AWK para o expr ( para multiplicar por 8 ), alguém consegue me ajudar?

# ls -l |grep arquivo | awk '{print $5}'
104857600

Att,
Gustavo




--
Atenciosamente,

Flavio Steimacher
DBA Oracle
LPIC1 - Linux Professional Institute Certified
CLA - Novell Certified Linux Administrator
DCTS - Novell Data Center Technical Specialist




--
✂----------------------------------------------------------------------
Sent from my Swiss Army Knife running Android® 

(0>
(/)_   about.me


reply via email to

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