|
From: | Ricardo A Reis |
Subject: | Re: [shell-script] Acho que eh eval |
Date: | Thu, 28 Apr 2005 14:59:23 -0200 |
User-agent: | Mozilla Thunderbird 1.0.2 (X11/20050415) |
$ ls | grep -f <(sed 's/^/\^/' Relatorio_de_nomes_incompleto.txt) #[pid 14010] execve("/bin/ls", ["ls"], [/* 38 vars */]) = 0 #[pid 14011] execve("/bin/grep", ["grep", "-f", "/dev/fd/63"], [/* 38 vars */]) = 0 #[pid 14013] execve("/bin/sed", ["sed", "s/^/\\^/", "Relatorio_de_nomes_incompleto.tx"...], [/* 38 vars */]) = 0
Esta melhor mais mesmo assim é muito trabalho por nada.!! O arquivo Relatorio com 1000 entradas! Usando a solução com for e apenas um redirecionamento .. Sera assim a melhor forma de mensurar ?time $(for dir in $(<Relatorio_de_nomes_incompleto.txt);do if [ -d $PWD/$dir* ];then echo Existe:$dir;fi done)
zsh: no matches found: /tmp/Felip* zsh: command not found: Existe:Jurem zsh: 17807 exit 127 0.00s user 0.00s system 82% cpu 0.004 total Com XARGS! time ls | grep -f <(cat Relatorio_de_nomes_incompleto.txt | xargs echo ^{}) zsh: 5310 done ls |zsh: 1217 exit 1 grep -f <(cat Relatorio_de_nomes_incompleto.txt | xargs echo ^{})
ls 0.00s user 0.00s system 63% cpu 0.003 totalgrep -f <(cat Relatorio_de_nomes_incompleto.txt | xargs echo ^{}) 1.64s user 0.00s system 97% cpu 1.677 total
Atenciosamente Ricardo A. Reis UNIFESP - SENAI Unix and System Admin
[Prev in Thread] | Current Thread | [Next in Thread] |