There's two shells scripts: A.sh and B.sh
Another script C.sh will create a log containing:
- Host name
- User name
- Name of script
- Time at which the function was executed
- Description of function
- Status
Example:
<My hostname>
<My username>
A.sh
12:09:00 p.m "Initialize shell" OK
12:10:00 p.m. "Creating file" OK
12:11:00 p.m. "Creating backup" FAIL
B.sh
01:00:00 p.m "Initialize shell" OK
01:01:00 p.m. "Creating file" FAIL
01:02:00 p.m. "Creating backup" FAIL
The point is to obtain the success/failure status of each function and the time at which was executed and save it all to a log file. How do I check for the status of each function in a shell?