[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RES: [shell-script] Ainda Arquivos :)
From: |
Suporte Mitra |
Subject: |
RES: [shell-script] Ainda Arquivos :) |
Date: |
Thu, 17 May 2001 17:24:13 -0300 |
Brigadão Renato, tudo certo agora!!!
:)
-----Mensagem original-----
De: Renato Silveira [mailto:address@hidden]
Enviada em: quinta-feira, 17 de maio de 2001 16:21
Para: 'address@hidden'
Assunto: RES: [shell-script] Ainda Arquivos :)
Henrique,
Execute "man test"
> ----- Mensagem original -----
> De: Suporte Mitra [SMTP:address@hidden]
> Enviada em: Quinta-feira, 17 de Maio de 2001 16:11
> Para: address@hidden
> Assunto: [shell-script] Ainda Arquivos :)
>
> Amigos,
> ainda naum consegui, vou mudar o exemplo p/ ver se facilito:
>
> Ex.:
>
> if (arquivo tem conteudo); then
> executa comandos
> else
> não executa e sai
> fi
>
>
>
> Ou seja, preciso de uma forma de saber se o arquivo tem conteúdo ou
> não, se tiver o IF vai executar, senão ele sai.
>
> Novamente MUITO OBRIGADO!!
>
>
>
> Henrique Rebello
> (Suporte Mitra)
> Teresópolis - RJ - Brasil
>
>
>
>
>
>
> Yahoo! Groups Sponsor
>
>
> <http://rd.yahoo.com/M=201621.1431180.3015684.2/D=egroupmail/S=1700006580:
> N/A=616083/R=2/*http://store.yahoo.com/cgi-bin/clink?ydomains+merchant-ad:
> dmad/M=201621.1431180.3015684.2/D=egroupmail/S=1700006580:N/A=616083/R=3/9
> 90126724+http://domains.yahoo.com/>
> <http://rd.yahoo.com/M=201621.1431180.3015684.2/D=egroupmail/S=1700006580:
> N/A=616083/R=4/*http://store.yahoo.com/cgi-bin/clink?ydomains+merchant-ad:
> dmad/M=201621.1431180.3015684.2/D=egroupmail/S=1700006580:N/A=616083/R=5/9
> 90126724+http://domains.yahoo.com/>
> www.
>
> <http://us.adserver.yahoo.com/l?M=201621.1431180.3015684.2/D=egroupmail/S=
> 1700006580:N/A=616083/rand=228145527>
>
> Sair da lista: address@hidden
> Banco Dados: <http://www.egroups.com/group/shell-script>
>
> Seu uso do Yahoo! Groups é sujeito aos Termos do Serviço Yahoo!
> <http://docs.yahoo.com/info/terms/>.
Sair da lista: address@hidden
Banco Dados: http://www.egroups.com/group/shell-script
Seu uso do Yahoo! Groups é sujeito às regras descritas em:
http://docs.yahoo.com/info/terms/
From (no email address) Thu May 17 13:43:49 2001
Return-Path: <address@hidden>
X-Sender: address@hidden
X-Apparently-To: address@hidden
Received: (EGP: mail-7_1_3); 17 May 2001 20:43:48 -0000
Received: (qmail 32161 invoked from network); 17 May 2001 20:43:43 -0000
Received: from unknown (10.1.10.26) by l8.egroups.com with QMQP; 17 May 2001
20:43:43 -0000
Received: from unknown (HELO perninha.conectiva.com.br) (200.250.58.156) by
mta1 with SMTP; 17 May 2001 20:43:42 -0000
Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by
perninha.conectiva.com.br (Postfix) with SMTP id AE20316B6C for
<address@hidden>; Thu, 17 May 2001 17:43:31 -0300 (EST)
Received: (qmail 22988 invoked by uid 0); 17 May 2001 20:42:09 -0000
Received: from verde.distro.conectiva (10.0.17.77) by burns.conectiva with
SMTP; 17 May 2001 20:42:09 -0000
Date: Thu, 17 May 2001 17:51:20 -0300 (BRT)
X-Sender: verde@verde.distro.conectiva
To: address@hidden
Subject: Re: [shell-script] apagar linhas em branco
In-Reply-To: <address@hidden>
Message-ID: <Pine.LNX.4.21.0105171749040.822-100000@verde.distro.conectiva>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=iso-8859-1
Content-Transfer-Encoding: 8BIT
X-eGroups-From: # aurelio marinho jargas <address@hidden>
From: # aurelio marinho jargas <address@hidden>
aê julio,
@ 17/5, Julio Neves:
> ...
> ou contá-los:
>
> find / -type f -iname "*.mp3" | sed -n $=
>
>
> nota: o último sed é igual a wc -l (porém +rápido)
>
> Fala Aurélio!
> É a mesma dúvida de sempre: vc tem como testar se os bourne-shell da vida
> suportam esta construção "$=" ?
o $= é um comando do sed.
na última linha ($), aplique o comando = (imprima o núm da linha atual)
não 'aspei' porque o bash nem tenta expandir a "variável" pois
não é válida, o = não é [A-Za-z_]
por segurança é bom fazer
sed -n '$='
--
s·:(·>(·×^a]×http://www.verde666.org×^[:wq
From (no email address) Thu May 17 13:52:12 2001
Return-Path: <address@hidden>
X-Sender: address@hidden
X-Apparently-To: address@hidden
Received: (EGP: mail-7_1_3); 17 May 2001 20:52:12 -0000
Received: (qmail 54268 invoked from network); 17 May 2001 20:52:10 -0000
Received: from unknown (10.1.10.27) by l7.egroups.com with QMQP; 17 May 2001
20:52:10 -0000
Received: from unknown (HELO perninha.conectiva.com.br) (200.250.58.156) by
mta2 with SMTP; 17 May 2001 20:52:08 -0000
Received: from burns.conectiva (burns.conectiva [10.0.0.4]) by
perninha.conectiva.com.br (Postfix) with SMTP id 1A88D16B69 for
<address@hidden>; Thu, 17 May 2001 17:50:34 -0300 (EST)
Received: (qmail 25002 invoked by uid 0); 17 May 2001 20:49:12 -0000
Received: from verde.distro.conectiva (10.0.17.77) by burns.conectiva with
SMTP; 17 May 2001 20:49:12 -0000
Date: Thu, 17 May 2001 17:58:22 -0300 (BRT)
X-Sender: verde@verde.distro.conectiva
To: address@hidden
Subject: Re: <eu> Re: [shell-script] apagar linhas em branco
In-Reply-To: <Pine.LNX.4.21.0105171749040.822-100000@verde.distro.conectiva>
Message-ID: <Pine.LNX.4.21.0105171757330.822-100000@verde.distro.conectiva>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=iso-8859-1
Content-Transfer-Encoding: 8BIT
X-eGroups-From: # aurelio marinho jargas <address@hidden>
From: # aurelio marinho jargas <address@hidden>
putz, e eu falei caca de novo (hoje é o dia...)
[/etc] time cat termcap | wc -l
10445
real 0m0.047s
user 0m0.020s
sys 0m0.020s
[/etc] time cat termcap | sed -n $=
10445
real 0m0.057s
user 0m0.040s
sys 0m0.010s
o sed NÃO é + rápido...
@ 17/5, # aurelio marinho jargas:
> aê julio,
>
> @ 17/5, Julio Neves:
> > ...
> > ou contá-los:
> >
> > find / -type f -iname "*.mp3" | sed -n $=
> >
> >
> > nota: o último sed é igual a wc -l (porém +rápido)
> >
> > Fala Aurélio!
> > É a mesma dúvida de sempre: vc tem como testar se os bourne-shell da vida
> > suportam esta construção "$=" ?
>
> o $= é um comando do sed.
> na última linha ($), aplique o comando = (imprima o núm da linha atual)
>
> não 'aspei' porque o bash nem tenta expandir a "variável" pois
> não é válida, o = não é [A-Za-z_]
>
> por segurança é bom fazer
>
> sed -n '$='
>
>
>
--
s·:(·>(·×^a]×http://www.verde666.org×^[:wq