Hi, I am trying to write a shell script that waits until the number of files in a specified directory ( say ~/fit/) has reached a predefined number. What I've got so far is:
limit = 10
while [ls ~/fit/ | wc -l -lt $limit]
do
sleep 1
done
This says -lt is an invalid option to wc. I also tried
[$limit -gt ls ~/fit/ | wc -l]
but it didn't work either. Any help is greatly appreciated.