How can I do this with a BASH trick?
I have several directories and a file residing inside a directory:
Code:
$ ls Thanks in advance. |
It's crude but "for dir in `eval echo dir*`; do Something; done" could do.
|
Try
Code:
eval 'cp file1 dir*'{1..5}'*;' |
Quote:
Code:
$ ls |
Try
Code:
find . -type d -exec cp file1 '{}' \; You can include '-maxdepth 2' if you want to limit the number of subdirectory levels it will descend into. |
If they're in the same level then you'd prolly 'find ./* -maxdepth 0 -type d|xargs doSomething' or something.
|
All times are GMT -5. The time now is 09:25 PM. |