Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

UNIX Assignment 1. What is the difference between the functionality of the at an

ID: 3596852 • Letter: U

Question

UNIX Assignment

1. What is the difference between the functionality of the at and cron commands?

2. What is significant about the recursive nature of functions?

3. Review the function below and answer the questions below. Function mycp when called copies the file named in the first argument to the file named by the second argument.   

function mycp () {

case $# in

0)

exec 3<&0 4<&1

;;

1)

exec 3< $1 4<&1

;;

2)

exec 3< $1 4> $2

;;

*)

echo "Usage: mycp [source [dest]]"

return 1

;;

esac

cat <&3 >&4

exec 3<&- 4<&-

}

What happens if you supply one argument?

What happens if you supply no arguments?

Explain what is happening in line 18.

Explain what is happening in line 20.

4. Write a script named ifthen that prompts the user with >> and reads a string of text from the user. If the user enters a nonnull string, the script displays You entered: followed by the string; otherwise it displays Where is your input?. Use an if...then...else control structure to implement the two-way branch in the script. Use a test to determine if the user enters a null string. What do you have to do to avoid getting an error message when you prompt with >>?

Deliverables:

1.       Submit your results for both null and nonnull test cases in your homework doc.

2.       Submit your answer to the question regarding >> in your homework doc also.

Explanation / Answer

Answer Q1. What is the difference between the functionality of the at and cron commands?

Cron can be scheduled with different choices ( mainly sys admin work with it )
(minute,hour,month,dayofmonth,dayofweek). cron can be
edited,deleted,listed,scheduled at any time and for
repeated time intervals.
AT can be scheduled for once.cannot be edited, can be
deleted, can be listed.

so we can say 2 main differences:-
cron:can be scheduled for repeated jobs like daily hourly monthly or many more | AT: can be scheduled for only once not for repetative jobs

cron can be edited after it got scheduled ( corn -e ) | AT cannot be edited, after its schedule.