Check out this wonderful tool for your shell script which helps you to find bugs in your script :
Another example : script to check if a file exists or not :
This way it will help you to correctly write a shell script. Hope this is a useful tool for you!
for the last example, I did apply the suggestions and it worked like a charm :
Wow! Pretty doggone sweet! It not only tells where you're missing the boat,
but explains how!
This tool has a lot of built-in intelligence!!!
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.