in Technology by
What is the syntax of while loop in shell scripting?

1 Answer

0 votes
by

The while loop is used to repeat its block of commands a number of times. It is different from for loop, it iterates until the while condition is no longer true.

  1. while [ test_condition ]  
  2. do  
  3. commands...  
  4. done   

Related questions

0 votes
    What is the syntax of "nested if statement" in shell scripting?...
asked May 28, 2021 in Technology by JackTerrance
0 votes
    What is the syntax of "nested if statement" in shell scripting?...
asked Jan 19, 2021 in Technology by JackTerrance
0 votes
    What is the use of "$#" in Shell Scripting?...
asked May 28, 2021 in Technology by JackTerrance
0 votes
    What are the disadvantages of shell scripting?...
asked May 28, 2021 in Technology by JackTerrance
0 votes
    What are the advantages of shell scripting?...
asked May 28, 2021 in Technology by JackTerrance
0 votes
    What is the use of "$#" in Shell Scripting?...
asked Jan 19, 2021 in Technology by JackTerrance
0 votes
    What are the disadvantages of shell scripting?...
asked Jan 19, 2021 in Technology by JackTerrance
0 votes
    What are the advantages of shell scripting?...
asked Jan 19, 2021 in Technology by JackTerrance
0 votes
    Both following examples work in modern Bash but don't work in different sh shells (like QNX shell). ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 13, 2022 in Education by JackTerrance
0 votes
    Explain the syntax for for loop?...
asked Jan 17, 2021 in Technology by JackTerrance
+1 vote
    What is the code in a while loop that returns the output of the given code?...
asked Nov 8, 2020 in Technology by JackTerrance
+1 vote
    ____ allows you to loop through a block of code as long as the specified condition is true. a)Tag b)While c)For...
asked Oct 8, 2020 in Technology by JackTerrance
0 votes
    I wrote javascript code to solve the following problem >>> Write a function exponentiate that accepts two ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 5, 2022 in Education by JackTerrance
0 votes
    I have a program that loops through the lines of a book to match some tags I've created indicating ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    In the following program, if I set the variable $foo to the value 1 inside the first if statement, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
...