 As I've mentioned many times in the past, my full-time job is a firefighter. So I work, my department has a 24-on, 48-hour shift, 48-hour off shift. So I work 24 hours. I work from 8 a.m. one day to 8 a.m. the next day and then I have two days off. I have 48 hours before I have to go back in. That's a great schedule, I love it. The problem is sometimes you forget what day it is. So if I want to know what today's shift was, I wrote a little script and this is great for if you're creating some sort of calendar, just a script, a program to show what today's shift is. And when I run it, it's gonna tell me that today is B shift, which is true, because I got off this morning, so right now is B shift, because it goes A, B, C. Let's go ahead and look at this script real quick. It's a simple bash script and it could definitely be cleaned up a little bit, but it works how it works and it's not very long, works how it is. Basically, I've created a date for A, B and C and I had to give it a date that I knew was an A shift, a B shift and a C shift. So I picked a date right here of 2013. I actually wrote this script a long time ago, but I've used it a number of times. I know that this day was an A shift, this day was a B shift, it was a C shift. Really, I should have only had to put that one date in and then for B and C shift, I could have added the number of seconds I needed to get to that next day, but it was just easy enough to copy and paste this in here. But we're not just getting that date, we're getting that date in seconds. So epoch time, number of seconds since 1970. So January 1st, 1970 at midnight. It's how many seconds it's been, that's important. Then I got today's date. Why I did it this way, I'm not really sure because I should have just gotten it as seconds because the next command I do convert to seconds. So again, this script could be cleaned up a little bit, but basically I'm getting these dates and I'm getting them in seconds and I'm getting this date in seconds since 1970, January 1st at midnight. And then what I'm gonna do is I'm gonna take that date, the today's date, I'm gonna subtract the number of seconds from the original date. So it's an older date, so it's a smaller number, so I should get a positive number. Then I'm gonna divide it by 24 times 3,600, 3,600. That's number of seconds in an hour and then we multiply that 24. So we're getting the number of seconds in a 24 hour period. So then what we're doing is, here we're doing percent three. What that does is it divides it and tells us if there's a remainder. So when we do this, it's going to go, then we're going to check if it is divisible by three, that means that it is that day. Does that make sense? I sure hope so. So basically we're gonna get that for A, B and C. Then we're gonna check is A zero, is B zero, is C zero. Again, meaning that there's no remainder, meaning it's evenly divisible by three. If it's evenly divisible by three because it's a three-day shift, then we know that it's that day. So we're saying, okay, if A, whatever we calculate out up here, equals zero, then we're echoing that today is A shift. If B equals zero, then we're echoing out today as B shift and if C is zero, then we're echoing out today as a C shift and that should always work, at least for a schedule like this. Might be a little more complicated if you have, there are other types of firefighter schedules, 12 hours. Here you work a number of 12 hours, then you have a certain number of days off. Some people work 48 hours, then have 72 off. It's all types of different stuff. But for my schedule, this works, short and simple. Could be shortened up a little bit more, but works as is and I've used it a number of times in different programs and I've done it in different languages because the same concept applies because it's just basically doing that. I do thank you for watching. Please visit my website, filmsbychrist.com. That's Chris at the C. There's a link in the description. If you enjoy my videos, think about liking, sharing, subscribing, commenting, supporting me in the sports section on my website, Patreon, PayPal, LibrePay, which no one's ever given me money there, but that's there. I do thank you for watching and I hope that you have a great day. Again, the script is in the link in the description if I don't forget. Have a great day.