Machine-translated by Google. Questions are authored in English.
Top

Discussion

The output generated by the LINUX command : $ seq 1 2 10 will be

  • A.1 2 10
  • B.1 2 3 4 5 6 7 8 9 10
  • C.1 3 5 7 9
  • D.1 5 10

Answer: C

The command prints 1 3 5 7 9.

seq FIRST INCREMENT LAST prints numbers from the first, adding the increment until the last is passed. Here it starts at 1, steps by 2 and stops at 9, which is under 10.

The other options ignore the increment of 2 or print a different set. The general form is seq first increment last, and with only two arguments the increment defaults to 1. With three arguments, as here, the middle one is the step, so the sequence is 1, 3, 5, 7, 9 and the next value, 11, would exceed the last value of 10.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.