[linux] xargs - jednoduche

Matus UHLAR - fantomas uhlar na fantomas.sk
Čtvrtek Leden 8 15:05:45 CET 2004


On 08.01 14:30, Peto V. wrote:
> Potrebujem cosi take:
> cp file do /tmp/*(vsetky dir!)
> cp file do /tmp/*(vsetky dir!)/a*.tmp/

potrebuje s cyklus - cp dokaze skopirovat jeden alebo viac suborov na
jedno miesto, nie jeden subor na viac miest

toto by malo ist:

for dir in `find /tmp -type d -mindepth 1 -maxdepth 1`
do
	cp $file $dir
	for dir2 in `find $dir -type d -mindepth 1 -maxdepth 1 -name 'a*.tmp'
	do
		cp $file $dir2
	done
done


-- 
Matus UHLAR - fantomas, uhlar na fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Eagles may soar, but weasels don't get sucked into jet engines. 



Další informace o konferenci linux