Syntax error near unexpected token :( please help
i got this script from website for inviting peoples to game and earning points easily ...but this seems not working and giving error..any help in correcting it and sharing knowledge is much appreciated
#!/bin/bash/sh #Store arguments from bash command line username=$1 cycles=$2 i=$1 if [ -z ${username} ] || [ ! -e ./cookies/${username} ] then echo "Error: Login to your E-Mail Account" echo exit if [ +z ${username}] || [!-e./cookies/${username} ] then echo "successfull" echo exit if [ -z ${cycles} ] then echo "Default Cycle to 1" cycles=1 fi while [ $i -le ${cycles} ] do echo "Running cycle ${i}" curl -s -b ./cookies/$username -A "Mozilla/5.0" -d @./data/acashdat "http://apps.facebook.com/fightersc/recruiter?from=money&sent=1" > |
'if' statements need a closing 'fi' line -there are two missing in the posted code. Also, the 'while' needs a closing 'done' line.
|
thanks alot buddy :) it worked in that script but couldnt get it right in this one..its similar to first but for differect activity
#!/bin/bash fid=$1 email=$2 if [ -z ${email} ] || [ ! -e ./cookies/${email} ] then echo "You need to specify a logged in email address" echo "that person must be already supporting the fight" echo exit fi while [ 1 ] do curl -s -b ./cookies/$email -A "Mozilla/5.0" "http://apps.facebook.com/fightersc/details?fid=${fid}&hit=1" | sed -n "s/.*opponent\" value=\"\([0-9]*\)\" .*/\1/p" | while read i; do echo "Got one! beating the shit out of ${i}" curl -s -I -b ./cookies/$email -A "Mozilla/5.0" "http://apps.facebook.com/fightersc/details?fid=${fid}&hit=1&emoticon=119&opponent=${i}&versailles=hit+opponent" > /dev/null& curl -s -I -b ./cookies/$email -A "Mozilla/5.0" "http://apps.facebook.com/fightersc/details?fid=${fid}&hit=1&emoticon=119&opponent=${i}&versailles=hit+opponent" > /dev/null& done done |
It's easier to read your script if you put it in code tags (that's a link to instructions or you may prefer to use "Advanced Edit" mode which has a # button for code tags). This will preserve the indentation you are (hopefully) using.
Please post the output too. It should show information about the line number(s) generating the error. |
Where are you getting these scripts?
Regardless, please put code like this into code tags (switch to advanced mode if necessary) In your latest script, I am not sure what happens when you pipe data into the "while read i......" construct. "read" takes data from standard input, unless told otherwise. Example: To read from a file: Code:
while read line; do |
All times are GMT -5. The time now is 11:12 PM. |