Perhaps you want to use cp -r in this script. This will copy the source recursively, including directories. Directories will be copied and messages will disappear.
If you do not want to copy directories, you can do the following:
- redirect stderr to stdout with
2>&1 - prints output to grep -v
script | grep -v 'omitting directory'
quote from grep man page:
-v,
source share