I have a dir that contains files and subdirs. I want to copy files in the dirs only, so I run
cp -v src/* dst/
and get error cp: -r not specified; omitting directory
. I'd be ok to ignore it but the command fails if the -e
bash flag is set.
How can I avoid my script failure assuming I do NOT want to copy recursively and I do want -e
flag? The only thing I can think about is to use find -type f -maxdepth... -exec cp...
but it looks too heavy. Any simpler way?
p.s. I know about -e
bottom rocks, thanks.
|| true
to the command eliminate the failure when-e
is set?