I will check if directory exists, if yes it should run the copy command.
If copy fails,then it should echo "Failed" and exit the script.
But it not exiting and run the next shell script.
I also tried below
( cp "DIRECTORY"/* "ADIRECTORY" && echo copy; ) || ( echo "Failed" && exit 1)
but it also not working as expected.When the cp operation success it should echo copy and run product.sh ,when cp operation failed it should echo Failed and exit the script and not running product.sh
if [[ -d DIRECTORY && -d ADIRECTORY ]];
( cp "DIRECTORY"/* "ADIRECTORY" && echo copy; ) || ( echo "Failed" ; exit 1;)
source product.sh ;
echo "Dir not found ";