I want to create a bash script inside Linux terminal to go into a file and then delete it if it's empty:#!/bin/bashecho  Enter name of a directoryread Dirfor Directory in $( ls $HOME )do   test -d $HOME/$dir  if [ $# -eq 0 ]  then     for filename in $( ls $HOME/$Dir )    do       test -d $HOME/$dir/$filename      if [ ! -s $filename  ]      then        rm $HOME/$dir/$filename      else         echo  not empty      fi     done   else     echo  $Dir is not a directory   fi doneThis is the code I am using but it does not work. It recognizes the file created but doesn't delete it even when empty. It Salah displays there is no such file or directory 
Remove files with 0 length inside bash
linux;bash