I'm using Mac OS X. I'm trying to copying some files with cp command for a build script like this.
cp ./src/*/*.h ./aaa
But this command fires an error if there is no .h file in ./src directory. How to make the command don't fire the error? (silent failure) The error makes build result fail, but I just want to copy when only there are some header file.
:means in this context. – Piotr Dobrogost Feb 10 '14 at 15:35cp(should that be desired). The shell builtintruecould be used instead and would be more readable. – Dennis Williamson Feb 10 '14 at 15:46:– [What Is the Purpose of the `:' (colon) GNU Bash Builtin?](http://stackoverflow.com/q/3224878/95735) – Piotr Dobrogost Feb 10 '14 at 15:49cpnot being inPATHsomehow...) – Vladimir Panteleev Oct 24 '18 at 19:32||regardless of operating system. What doesfalse || echo "OR"output for you? – Dennis Williamson Jul 25 '19 at 22:10bash ./scriptnamefor example? Or with a shebang like#!/bin/bash? Or do you have stray characters in your script such as Windows/DOS line endings\r\n? – Dennis Williamson Jul 26 '19 at 02:55