find, grep, xargs...
Jan Pechanec
jp at devnull.cz
Thu Apr 10 13:18:42 CEST 2008
On Thu, 10 Apr 2008, Lubomir Majersky wrote:
>Jiri Calda wrote / napísal(a):
>> Lubomir Majersky wrote:
>>
>>> find . -type f -print | xargs grep -lE 'vzorka-XYZ' > ./vystup.txt &&
>>> grep -iE 'vzorka-ABC' ./vystup.txt | xargs -J % cp -p % ../adresar
>>>
>> find . -name "vzorek*" -exec cp {} adresar \;
>> ^^^^^^^^^^^^^^^ ^^^^^^^^
>...toto nie. Ja najskor musim spracovat vzorku, ktora hladam v obsahu
>suborov
aha, to v zadani nebylo. Muzes to udelat takhle:
grep -lRE pattern | grep -i 'blabla*' | xargs...
nebo
cp `grep -lRE pattern | grep -i 'blabla*'` ...
--
Jan Pechanec <jp (at) devnull (dot) cz>
http://www.devnull.cz
More information about the Users-l
mailing list