Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

My bash timer doesn't stop, just loops

Jonaz

Coder
So, I'm writing a small script to execute 2 commands with 2 seconds apart, and then stop. Everything works fine, except that it doesn't stop.

Code:
echo ""
echo -e "${GREEN}${NC}Loading simple script $version by Jonaz Thern - my@email\e[0m"
echo ""
while :
do
    for ((i=1; i>0; i--))
    do
    sleep 2
    echo -e "${RED}${NC}sudo crossystem dev_boot_usb=1 dev_boot_legacy=1\e[0m"
    done
    sleep 2
    echo -e "${RED}${NC}cd; curl -LO https://mrchromebox.tech/firmware-util.sh && sudo bash firmware-util.sh\e[0m"
done
echo ""
echo -e "${GREEN}${NC}Completed in $SECONDS seconds\e[0m"

What did I do wrong? :(
 
Last edited:
Back
Top Bottom