how to detect errors in unzip

Hello

I am trying to write a script that internally will invoke unzip on some .zip file
I would like to make my script robust by checking for any possible error that might occur during the unzipping.

Are there any arguments that I can add to the unzip command which will let me know if an error occurred during the unzipping process?
then I will check for these errors in the

thanks

Make use of the special variable $?. It holds the exit status of the command just executed.

Have something like this in your script.

unzip file.zip
if [[ $? == 0 ]] ; then
echo "Success"
else
echo "Some failure."
fi ;

Look into man unzip for the types of possible errors that can be encountered.

thanks for the answer
I would like to test my code by intentionally causing a problem
For example,
assume that I have a file called test.txt
I would like to zip test.txt into test.zip
The I want to lock test.txt somehow
next I will try to unzip test.zip. but since it tries to write into a locked file,
I hope the unzip will fail

Will that work?
if so, how can I lock a file in linux and then unlock it
I am using putty to interact with linux so all I have is a simple command shell

thanks in advance