copy
hi,
I am trying to make a short script to copy files, whole tree structures ... This is how I started ###3 copyTree - cp tree structure: copyTree "*.dat" "*.txt" "C:/...." Code:
function copyTree() { copyTree "*.dat" "C:/...." but not works when trying copyTree "*.dat" "*.txt" "C:/...." Why? thanks |
Hi,
If you want to use more then one -name option with find you need to add the -o (OR) option. I.e: find -depth -name "$1" -o -name "$2" -print0 or find -depth \( -name "$1" -o -name "$2" \) -print0 BTW: The first example will not always work, the second will. Hope this helps. |
I tried bot suggestion
Code:
###3 copyTree - cp tree structure: copyTree "*.*" "C:/...." |
Hi,
I see another typo/mistake in your script: find -depth -name "$1" -o -name "$2" -print0 | cpio --null -pvd $2 Should be: find -depth -name "$1" -o -name "$2" -print0 | cpio --null -pvd $3 And the find..cpio line below that should end with $4 instead of $2. Hope this helps. |
true ... you are very good observer
|
All times are GMT -5. The time now is 01:43 AM. |