How to find/display out last Friday's date of the month
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Can you please help me find/display out last Friday's date of the month using command in Unix/Linux
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.
Well it has been well over a day since the original post so I have a question for all contributors to this thread. I'm not totally clear what the OP is after but what about the "cal" command? The entire present month is displayed like a calendar and it's easy to see what the date was last Friday. ?? Comments? Am I way off base here?
Judging by what the OP wrote in the Ubuntu thread that was also started, I assume that what was wanted was a command that would output the date of the final Friday of the current month. In that thread, the OP wrote, "The output date should be 29 march...." I'm guessing that that he didn't want something like echo "29 march", and that simply looking at a calendar wouldn't do, either.
I had read the problem as the day of the month for "last Friday", instead of the date of the final Friday of the month. Incidentally, "last Friday" is a valid argument for the -d argument.
Being able to clearly express a problem requires a student to first organize his thoughts. This could even lead to a solution. Maybe, for these homework problems, we should ask the original posters to restate the problem clearly and unambiguously if the description is muddled, and then to provide information on what they tried, or a description on how they believe they need to proceed to solve the problem.