Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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'
share|improve this question
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 8:38
    
@jasonwryan i fixed it –  Educ Sep 25 '14 at 17:00

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
    
Thanks so much its works fine –  Educ Sep 25 '14 at 8:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.