1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dominik [7]
3 years ago
6

In the following shell scripting extract, the initial values of variables s, c and p are 0, 1, 1 respectively. What will be the

final value of s, at the end of the while loop?

Computers and Technology
1 answer:
____ [38]3 years ago
3 0

Answer:

The first example simply counts the number of lines in an input file. It does so by iterating over all lines of a file using a while loop, performing a read operation in the loop header. While there is a line to process, the loop body will be executed in this case simply increasing a counter by ((counter++)). Additionally the current line is written into a file, whose name is specified by the variable file, by echoing the value of the variable line and redirecting the standard output of the variable to $file. the current line to file. The latter is not needed for the line count, of course, but demonstrates how to check for success of an operation: the special variable $? will contain the return code from the previous command (the redirected echo). By Unix convention, success is indicated by a return code of 0, all other values are error code with application specific meaning.

Another important issue to consider is that the integer variable, over which iteration is performed should always count down so that the analysis can find a bound. This might require some restructuring of the code, as in the following example, where an explicit counter z is introduced for this purpose. After the loop, the line count and the contents of the last line are printed, using echo. Of course, there is a Linux command that already implements line-count functionality: wc (for word-count) prints, when called with option -l, the number of lines in the file. We use this to check wether our line count is correct, demonstrating numeric operations on the way.

You might be interested in
Which of the following statements is true of alert files?
ozzi

Answer:

They are only generated by Wireshark.

3 0
3 years ago
What process combines data from a list with the content of a document to provide personalized documents?
Andrej [43]
The appropriate answer is d. mail merge. Mail merge uses a database of addresses that are used to create pre-addressed mailing labels that are generally used when sending letters to a very large group. This type of application is used by utility companies or any other organizations that requires mass mailings. Mail merge is found in the Microsoft Word application. Excell spreadsheets can also be used to complete tasks similar to that of mail merge.
8 0
3 years ago
Read 2 more answers
Wamna play mm2<br><br><br>imma send u my username​
SashulF [63]

Answer:

sure send it lol but how

6 0
3 years ago
What is the best definition of a network?
Nataliya [291]

Answer:

like tv or wifi

Explanation:

6 0
3 years ago
Read 2 more answers
All data process by a computer must be in 1. binary form 2. Hexadecimal form 3. Duodecimal form 4. Unitary form?
avanturin [10]

Binary code I believe.

3 0
3 years ago
Read 2 more answers
Other questions:
  • According to your textbook, the three major criteria against which to test documents that you locate on the Internet are authors
    8·1 answer
  • What will happen with communication methods in five years?
    8·1 answer
  • What's the ASCII code for boy ?
    15·1 answer
  • You asked your colleague to provide feedback on a blog post you recently wrote. When they sent you their feedback, they made edi
    10·1 answer
  • If you want to learn more about a command, point to its button and wait for the ____ to appear.
    13·1 answer
  • What happens when a computer gets a virus?
    6·2 answers
  • In your own words, describe how a network administrator can use the OSI model to isolate a network problem.
    13·1 answer
  • Who is the father of computer?​
    6·1 answer
  • Choose the answer. Janice's IT department found that her computer had a program on it that was collecting her personal informati
    5·1 answer
  • Which of these statements about PNG is true?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!