- Write a program 'suffix' that renames a file by adding the characters given as the second argument to the end of the name of the file given as the first argument. So.....
suffix memo1 .sv
should rename memo1 to memo1.sv.
- Write a program called "t" that displays the time of day in a.m. or p.m. notation rather than in 24-hour clock time. Here's an example showing "t" run at night:
$ date
Wed Aug 28 19:34:01 EDT 2002
$ t
7:21 pm
$
Use the shell's built-in integer arithmetic to convert from 24-hour clock time. Then rewrite the program to use a case command instead. Rewrite it again to perform arithmetic with the expr command.
- Here are two programs called prog1 and prog2:
$ cat prog1
e1=100
export e1
e2=200
e3=300 prog2
$ cat prog2
echo $e1 $e2 $e3 $e4
$
What output would you expect after typing the following:
$ e2=20; export e2
$ e4=40 prog1
Thank you