Hi, I am trying to check if the contents of a folder is empty and if it is I would like to execute a command to remove the contents of another folder. I thought I could do this with an if then statement and defining an argument although things are not quite working as planned.
If anyone could tell me what I am doing wrong or point me in the right direction I would greatly appreciate the help.
below is my script, In the first part I am using a command that returns the value of the contents of a folder and I am defining this as Argument $1 if argument 1 is equal to 0 then remove the contents of folder Application_fonts
Thanks very much
$1 = ls -1 | wc -l
if [ $1 -eq 0 ]
then
rm /Library/WebServer/Documents/Application_fonts/*
fi