2009/7/14 Patrick_Stiady <[email protected]>:
> Rekan-rekan,
>
> Saya menemukan file bash shell berikut untuk meng-copy file-file
> tertentu dari sub-directory secara recursive.
>
> #!/bin/bash
> cd /home/mydoc/eclipse
> find . -type d -name '*' -exec mkdir -p /media/disk/eclipse/{} \;
> find . -type f -name '*.java' -exec cp {} /media/disk/eclipse/{} \;
>
> Yang menjadi pertanyaan apakah fungsi \; pada akhir command find.
> Saya cari-cari di man find, tapi gak ngerti fungsinya.
>
> Terima kasih atas bantuannya.
dari man find:
...
ACTIONS
...
-exec command ;
Execute command; true if 0 status is returned. All
following arguments to find are taken to be argu‐
ments to the command until an argument consisting of
‘;’ is encountered. The string ‘{}’ is replaced
by the current file name being processed everywhere it
occurs in the arguments to the command, not just
in arguments where it is alone, as in some versions of
find. Both of these constructions might need to
be escaped (with a ‘\’) or quoted to protect them from
expansion by the shell...
--
FAQ milis di http://wiki.linux.or.id/FAQ_milis_tanya-jawab
Unsubscribe: kirim email ke [email protected]
Arsip dan info milis selengkapnya di http://linux.or.id/milis