Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8875871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:05:36+00:00 2026-06-14T19:05:36+00:00

I am making a bash script. the objective is: execute a program wait some

  • 0

I am making a bash script. the objective is:
execute a program wait some seconds reset the program and repeat the process.
I make 2 scripts but i don’t know where is the error…

 #!/bin/bash
while true; 
do 
seg=`date +%M`;
if [[ "$seg" -eq "30" ]]; 
then killall sox;
echo "reset"; 
fi
done

bash: error sintáctico cerca del elemento inesperado `;’

#!/bin/bash
while true;
do
nice -n-10 sox -q -V0 --multi-threaded -t alsa hw:2,0 -t alsa pcm.default && 
done

bash: error sintáctico cerca del elemento inesperado `done’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:05:37+00:00Added an answer on June 14, 2026 at 7:05 pm

    Issues with Script #1:

    The ; notation is to run multiple commands on the same line, one after another. Bash syntax requires that while and do on separate lines (same with if ... and then, and separated by ; if on the same line. Command statements are not normally terminated with a ; char in bash.

    Change your code from:

    #!/bin/bash
    while true; 
    do 
    seg=`date +%M`;
    if [[ "$seg" -eq "30" ]]; 
    then killall sox;
    echo "reset"; 
    fi
    done
    

    To:

    #!/bin/bash
    while true
    do 
        seg=`date +%M`
        if [[ "$seg" -eq "30" ]]; then
            killall sox
            echo "reset"
        fi
    done
    

    Issues with Script #2:

    & means to run the command as a background process. && is used for conditional command chaining, as in: “If the previous command before && succeeds, then run the next command after the &&“

    Change from:

    #!/bin/bash
    while true;
    do
    nice -n-10 sox -q -V0 --multi-threaded -t alsa hw:2,0 -t alsa pcm.default && 
    done
    

    To:

    #!/bin/bash
    while true
    do
        nice -n-10 sox -q -V0 --multi-threaded -t alsa hw:2,0 -t alsa pcm.default &
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a bash script that will talk to a java program
I'm learning bash but now I'm having a lot of trouble making this script
I'm doing some script on bash to plot data with gnuplot. But it doesn't
i was making a bash script for my server which pack some directories with
I am attempting to write a bash script and I am having difficulty making
Part of a bash script I'm making involves rar splitting files and then moving
I've written a bash logging library to be implemented with some complex scripts that
I tried running a script file using bash but it showed an error bash-3.2$
I'm making a bash script in which I need to print a number while
I have a bash script to add some files of a project to git

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.