Calculating Total Hours worked


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Calculating Total Hours worked
# 1  
Old 04-21-2019
Calculating Total Hours worked

Write a script using a Linux shell programming language to perform clock management for a small daycare.

The program should manage all time in and out routines. At the end of the each day should give the Total hours worked that day.

Example:


Code:
Time-In 6:30am
Lunch-Out 11 :25am
Lunch-In 11:40pm
Time-Out 5:30pm
Total Hours Worked =

I have no clue where to start. I tried take in the user's input for IN/OUT Time, but then I'm not sure how to parse it to calculate the total hours. Not sure if there is another approach for this.

Moderator's Comments:
Mod Comment Please use code tags for samples, as per forum rules.

Last edited by RavinderSingh13; 04-21-2019 at 10:37 PM..
# 2  
Old 04-22-2019
Quote:
Originally Posted by sarapham409
Write a script using a Linux shell programming language to perform clock management for a small daycare.

The program should manage all time in and out routines. At the end of the each day should give the Total hours worked that day.

Example:


Code:
Time-In 6:30am
Lunch-Out 11 :25am
Lunch-In 11:40pm
Time-Out 5:30pm
Total Hours Worked =

I have no clue where to start. I tried take in the user's input for IN/OUT Time, but then I'm not sure how to parse it to calculate the total hours. Not sure if there is another approach for this.

Moderator's Comments:
Mod Comment Please use code tags for samples, as per forum rules.
This appears to be homework.

Quote:
Write a script using a Linux shell programming language to perform clock management for a small daycare.
That sounds like an assignment given to a student.

Kindly confirm.

Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Performance of calculating total number of matching records in multiple files

Hello Friends, I've been trying to calculate total number of a certain match in multiple data records files (DRs). Let say I have a daily created folders for each day since the beginning of july like the following drwxrwxrwx 2 mmsuper med 65536 Jul 1 23:59 20150701 drwxrwxrwx 2 mmsuper... (1 Reply)
Discussion started by: EAGL€
1 Replies

2. Homework & Coursework Questions

Calculating Total and Averages with awk Commands & Scripts

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write an awk script(company.awk) for the workers file to find the number of workers of each departman, total... (8 Replies)
Discussion started by: RedJohn
8 Replies

3. Shell Programming and Scripting

Calculating the epoch time from standard time using awk and calculating the duration

Hi All, I have the following time stamp data in 2 columns Date TimeStamp(also with milliseconds) 05/23/2012 08:30:11.250 05/23/2012 08:30:15.500 05/23/2012 08:31.15.500 . . etc From this data I need the following output. 0.00( row1-row1 in seconds) 04.25( row2-row1 in... (5 Replies)
Discussion started by: ks_reddy
5 Replies

4. Emergency UNIX and Linux Support

Calculating total space in GB for all files with typical pattern

Hi Experts, In a particular dir, I have many files *AJAY*. How can I get total size of all such files. I tried du -hs *AJAY* but it gave me individual size of all files. All I require is summation of all. Thanks, Ajay (4 Replies)
Discussion started by: ajaypatil_am
4 Replies

5. UNIX for Dummies Questions & Answers

Calculating the Hours between two time values

Dear Folks, I want to calculate the elapsed hours between two time columns. I am using timestampdiff method for the same. I am able to get the value. But facing an issue of decimal values. For example the elapsed hours between 09:00:00 and 20:30:00 is coming as 11 instead of 11.5. I am using below... (1 Reply)
Discussion started by: dinesh1985
1 Replies

6. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

7. Shell Programming and Scripting

how to list files between last 6 hours to 3 hours

Hi Frens, I want to list some files from a directory, which contains "DONE" in their name, i am receiving files every minute. In this i want to list all the files which are newer than 6 hours but older than 3 hours, of current time i dont want my list to contain the latest files which are ... (4 Replies)
Discussion started by: Prat007
4 Replies

8. UNIX for Dummies Questions & Answers

grep running total/ final total across multiple files

Ok, another fun hiccup in my UNIX learning curve. I am trying to count the number of occurrences of an IP address across multiple files named example.hits. I can extract the number of occurrences from the files individually but when you use grep -c with multiple files you get the output similar to... (5 Replies)
Discussion started by: MrAd
5 Replies
Login or Register to Ask a Question