I am actually a beginner shell script developer, and i was given a script to work on, but i have not been able to successfully fix it, even after several days of studying. I want the script below to actually check a site and tell me which emails are already registered on the from the list of emails i will parse to it, and also save this emails. The main challenge is that the code doesn't run at all, but i have a feeling i am close to making it work, and the fact that i always get the error "/bin/bash^M: bad interpreter: No such file or directory" when i try to run the code just sucks. I need help. Thanks Below is the code i have at the moment.
#!bin/bash
#ebay.sh
CheckBay(){
wget -q "https://reg.bay.com/reg/ajax?
email=${em}&countryId=1&mode=5&eId=email" -O tmp/ganteng.txt
cat tmp/ganteng.txt | grep "Your email address is already registered
with eBay" > /dev/null;cekh=$?
if [ $cekh -eq 0 ];then
echo -e "[+] $em = \033[1m\e[1;32m[Valid in ebay]\E[0m"
echo -e "[+] $em = \033[1m\e[1;32m[Valid in ebay]\E[0m" >> log.txt
echo "$em" >> validebay.txt
else
echo -e "[+] $em = \033[1m\e[1;31m[Not Valid in ebay]\E[0m"
echo -e "[+] $em = \033[1m\e[1;31m[Not Valid in ebay]\E[0m" >> log.txt
echo "$em" >> notvalidebay.txt
fi
rm -f tmp/*
}
run(){
for em in `cat $email`
do
CheckBay $em
done
}
detail(){
if [ ! -d tmp ];then
mkdir tmp
fi
if [ ! -f $list ];then
echo "[?] file $email Not Found [!]"
exit
fi
}
read -p "[+] Enter list email = " email
detail
run
N/B: This is learning please, and i really need to be better