Testable and self-contained bash script I wrote a short bash script for a completion check of downloading images. If you have any good ideas, please tell me them. Thank you.
#!/bin/sh

# if a directory name is assigned

if [ $# -eq 1 ]; then

  a=`ls -1 $1/*.jpg | wc -l`
  b=`grep jpg $1/tmp.sh | wc -l`
  if [ $a = $b ]; then
    echo $1
  fi
  exit
fi

# if some directory names are assigned

if [ $# -gt 1 ]; then
  for dir1 in &quot;$@&quot;; do
    ./done.sh $dir1
  done
fi

# if directory names are not assigned

if [ $# -eq 0 ]; then
  ls -d */ | xargs ./done.sh
fi
Good

good indentation
somewhat helpful comments
good to do the ; then bit on the same line as the if

Suggestions

use double brackets for conditionals
try shellcheck (It will tell you to put quotes around your variable substitutions.)
put your arguments into named variables so you don't keep have to referring to $1
put the 3 sections into if...elif...else structure to make clear that you're only going to go into one of them
check for the existance of ./done.sh at the beginning
explain what the goal of the script is somewhere.