티스토리 뷰

공부

[sh] ignore error `cp from to | true`

승가비 2023. 1. 5. 02:12
728x90
cp ./src/*/*.h ./aaa | true
 

https://serverfault.com/questions/153875/how-to-let-cp-command-dont-fire-an-error-when-source-file-does-not-exist

 

How to let 'cp' command don't fire an error when source file does not exist?

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. ...

serverfault.com

 

728x90
댓글