Write a script to display the time every 15 seconds. Read the date man page and display the time, using the %r field descriptor. Clear the window (using the clear command) each time before you display the time.

Respuesta :

Explanation:

An infinite bash while loop can be used to implement the logic

The syntax of infinite bash while loop is

while :

do

# statements

done

We can create any desired date and time format by utilizing the field descriptors. Field descriptors denote various components of date and time

For example:

date +  %r       %I:%M:%S %p

date + %D %m/%d/%y

date + %R %H:%M

echo command displays the contents of the variable Time

sleep 15 represents a gap of 15 seconds between the display

Then clear command is used to clear the window

Linux Code:

while :

do

Time ='date + %r'  

echo -n $Time

sleep 15

clear

done

In this exercise we have to use the knowledge in computational language in linux to describe a code that best suits, so we have:

The code can be found in the attached image.

What is looping in programming?

In a very summarized way, we can describe the loop or looping in software as an instruction that keeps repeating itself until a certain condition is met.

To make it simpler we can write this code as:

date +  %r       %I:%M:%S %p

date + %D %m/%d/%y

date + %R %H:%M

while :

do

Time ='date + %r'  

echo -n $Time

sleep 15

clear

done

See more about linux code at brainly.com/question/7554734

Ver imagen lhmarianateixeira
ACCESS MORE