Another way:
cp /folder/path /to/path && cp /anotherfolder/path /to/anotherpath && { echo "suceeded" } || { echo "failed" }
I tested it:
david@pcdavid :~$ cp test.tex a && cp test.aux b && { echo "haha"; } || { echo "hoho"; } haha david@pcdavid :~$ cp test.ztex a && cp test.aux b && { echo "haha"; } || { echo "hoho"; } cp: cannot stat `test.ztex': No such file or directory hoho david@pcdavid :~$ cp test.tex a && cp test.zaux b && { echo "haha"; } || { echo "hoho"; } cp: cannot stat `test.zaux': No such file or directory hoho
source share