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

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

Re: [shell-script] tamanho


From: Thobias Salazar Trevisan
Subject: Re: [shell-script] tamanho
Date: Tue, 8 Apr 2003 12:07:03 -0300 (EST)

ae,

On Tue, 8 Apr 2003, rettore wrote:

> Preciso fazer um script em linux que pegue no /home  de cada
> usuario e
> localize os arquivos .exe e me forneça o tamanho de todos ex da
> saida
>
> /home/fulano
> exe = 3256kb
> /home/testano
> exe = 32569kb
>
> OBS: ele precisa somar o tamanho de todos

nao testado, mas deve funcionar:

#!/bin/bash

cd /home
for i in *;do
echo $i
echo "exe = $(find . -name \*.exe -exec ls -l {} \; |\
awk '{print $5}' | sed ':a;N;s/\n/+/;ta' | bc)"
done
cd -


thobias
-------
echo 24883721290304465999833114447114149701898P | dc
-------
http://www.lcp.coppe.ufrj.br/~thobias

____________________________
|
| Against - HTML Mail
| Against - MS ATTACHMENTS
|
----------------------------



reply via email to

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