请修该这个脚本

#!/bin/bash
#
currentdir= pwd
echo "$cutrrentdir"
if[ -d "takejpg"]; then
else
mkdir takejpg
fi

for f in *.jpg
cp "$f" "$current/takejpg"
rm -f "$f"

for dir in *
do
if [ -d "$dir" ]
cd "dir"
cp "$current/takejpg.sh" .
./takejpg.sh
rm -f takejpg.sh
cd ..
done

#把一个目录下所有jpg格式第归的转移到指定目录