./SFL.sh line 65: '\E[37M\E[1mLight=temp' command not found.
#!/bin/bash
#vim: tabstop=4:softtabstop=4:shiftwidth=4:noexpandtab:autoindent
#function to initlize round one of set for life
function InitUK1 {
#11 lights 3 red, 8 white, play for money then play for time
#put all the lights into an array
LIGHTS[1]="$(tput setaf 1;tput bold;)Light$(tput sgr0)";
LIGHTS[2]="$(tput setaf 1;tput bold;)Light$(tput sgr0)";
LIGHTS[3]="$(tput setaf 1;tput bold;)Light$(tput sgr0)";
LIGHTS[4]="$(tput setaf 7;tput bold;)Light$(tput sgr0)";
LIGHTS[5]="$(tput setaf 7;tput bold;)Light$(tput sgr0)";
LIGHTS[6]="$(tput setaf 7;tput bold;)Light$(tput srg0)";
LIGHTS[7]="$(tput setaf 7;tput bold;)Light$(tput srg0)";
LIGHTS[8]="$(tput setaf 7;tput bold;)Light$(tput srg0)";
LIGHTS[9]="$(tput setaf 7;tput bold;)Light$(tput srg0)";
LIGHTS[10]="$(tput setaf 7;tput bold;)Light$(tput srg0)";
LIGHTS[11]="$(tput setaf 7;tput bold;)Light$(tput srg0)"
}
funciton InitUK2 {
#round two of for the rest of your life
#20 lights 16 white 4 red 4 red and you're dead
#reset the array
}
function Scramble {
#scrambles the array
local index;
local lightcount;
lightcount=${#LIGHTS[*]};
((index=lightcount))
while [[ $index > 0 ]];do
((target=RANDOM % index))
Swap $target $index;
((index -= 1))
done;
}
function Swap {
#swap array elements
temp=${LIGHTS[$1]};
${LIGHTS[$1]}=${LIGHTS[$2]};
${LIGHTS[$2]}=$temp;
}
function DisplayTest {
#print out the array before an after scrambleing
for i in ${LIGHTS[*]};do
echo "$i";
done;
}
InitUK1;
DisplayTest;
Scramble;
DisplayTest;
i think I figured it out, I forgot to place a $ before a varible
nope, I'm still getting the following errors
./SFL.sh: line 64: $'\E[37m\E[1mLight=\E[37m\E[1mLight': command not found ./SFL.sh: line 65: $'\E[37m\E[1mLight=\E[37m\E[1mLight': command not found ./SFL.sh: line 64: $'\E[31m\E[1mLight=\E[37m\E[1mLight': command not found ./SFL.sh: line 65: $'\E[37m\E[1mLight=\E[31m\E[1mLight': command not found ./SFL.sh: line 64: $'\E[31m\E[1mLight=\E[37m\E[1mLight': command not found ./SFL.sh: line 65: $'\E[37m\E[1mLight=\E[31m\E[1mLight': command not found ./SFL.sh: line 64: $'\E[37m\E[1mLight=\E[37m\E[1mLight': command not found ./SFL.sh: line 65: $'\E[37m\E[1mLight=\E[37m\E[1mLight': command not found ./SFL.sh: line 64: $'\E[37m\E[1mLight=\E[37m\E[1mLight': command not found ./SFL.sh: line 65: $'\E[37m\E[1mLight=\E[37m\E[1mLight': command not found ./SFL.sh: line 64: $'\E[31m\E[1mLight=\E[37m\E[1mLight': command not found ./SFL.sh: line 65: $'\E[37m\E[1mLight=\E[31m\E[1mLight': command not found ./SFL.sh: line 64: $'\E[31m\E[1mLight=\E[37m\E[1mLight': command not found ./SFL.sh: line 65: $'\E[37m\E[1mLight=\E[31m\E[1mLight': command not found ./SFL.sh: line 64: $'\E[31m\E[1mLight=\E[37m\E[1mLight': command not found ./SFL.sh: line 65: $'\E[37m\E[1mLight=\E[31m\E[1mLight': command not found ./SFL.sh: line 64: $'\E[31m\E[1mLight=\E[31m\E[1mLight': command not found ./SFL.sh: line 65: $'\E[31m\E[1mLight=\E[31m\E[1mLight': command not found ./SFL.sh: line 64: $'\E[31m\E[1mLight=\E[31m\E[1mLight': command not found ./SFL.sh: line 65: $'\E[31m\E[1mLight=\E[31m\E[1mLight': command not found ./SFL.sh: line 64: $'=\E[31m\E[1mLight': command not found ./SFL.sh: line 65: $'\E[31m\E[1mLight=': command not found
This post has been edited by Braber01: 21 December 2011 - 08:56 AM

New Topic/Question
Reply




MultiQuote






|