Whenever i execute the below scriptlet with out proper file name it deletes /tmp directory .
I guess this is because value of variable a didnt get initialized and there for rm -rf /tmp/ get executed and entire /tmp directory get deleted.
How would i avoid any empty variables to be used in script? as this is a classic case of destructive script.
echo "Enter file to delete from tmp"
if [ -z "/tmp/$a" ]
echo "File Doesnt Exist"
rm -rf /tmp/$a