2

I wrote this script

#!/bin/bash

if [ $# -ne 2 ] ;

 then

echo "\n      Usage : sh $0 BSSID interface   \n"

exit 0;
fi
while true;

 do

reaver -b $1 -i $2 -vv -N -g 10 -S -a

sleep 3603;

done

but i got this messages :

bash T.sh
T.sh :line 2: $'\r':command not found
T.sh :line 10: $'\r':command not found
T.sh :line 27: syntax error near unexpected token 'done'
T.sh: line 27: 'done'
Educ
  • 403
  • 1
  • 7
  • 11
  • 1
    Please don't post screenshots of text output, paste the actual text. You apparently have Windows line endings in your script... – jasonwryan Sep 25 '14 at 08:38
  • @jasonwryan i fixed it – Educ Sep 25 '14 at 17:00
  • 5
    Possible duplicate of [Why am I getting "line 1: $' :\r': command not found"?](https://unix.stackexchange.com/questions/391223/why-am-i-getting-line-1-r-command-not-found) and ['while read line do' cause: “syntax error near unexpected token `done'” in Linux bash script](https://unix.stackexchange.com/q/225055/5132) – JdeBP May 24 '19 at 15:48

1 Answers1

6

Script looks okay. If you had edited/created this on a windows machine and copied to *nix, a 'dos2unix' will fix this.

dos2nix T.sh

Install the 'dos2unix' rpm if 'dos2unix' returns a 'command not found' message.

Sreeraj
  • 4,984
  • 10
  • 38
  • 57