I want to check the existence of dir1 and dir2 directory but unable to execute it

view story

http://stackoverflow.com – I have to check the existence of the files dir1 and dir2 ,if they exists then delete them recursively else print some message. Please find below code for the same: This is giving me an error saying missing expression. Error: ./check.sh: line 16: [: missing `]' directory does not exist. Code: if [ -d "dir1"] && [-d "dir2"]; then echo "directory exists" echo "deleting existing files...." sleep 2 rm -r dir1 rn -r dir1 echo "exisitng files deleted!!" else echo "directory does not exist" fi What is wrong here?? (HowTos)