Help - Search - Members - Calendar
Full Version: How To Calculate Age By Date Of Birth
Linuxhelp > Support > Technical Support
Hi guys, i am really stuck with linux. sad.gif

As part of my assignment, i have to:

- "Ask the user's date of birth and calculate his or her age"

How would i write that in Linux, i am all new to this!

Please do not request others to help you with homework. You will learn more by doing it yourself. I do not mind providing hints but you did not provide enough information. Since we do not know what type of class this is nor what programming language your are learning if any nor the linux commands etc that you have already learned it will be difficult to provide help.
Shut up!
Dude, honestly, do your homework yourself. What they hell. When you boss askes you to write a script in a four years are you gonna come here and ask for help? As a CSci student myself I will promise you that you are far better off figuring it out for yourself.

And two, honestly dude, how hard is it to subtract the birthdate from the current date.

And three: If you actually expected us to help you, you would have to give us a little more information, like, of I don't know, what language you needed to do it in.
Guys! He didn't just type out his assignment, he asked for some pointers! By all means don't help, but there's no need to be rude to another.

I guess you are trying to use bash (the shell) to do it. Goggling "bash date functions" might bring up some info.

And two, honestly dude, how hard is it to subtract the birthdate from the current date.

TBH Jim, I couldn't do that in bash

Deep breath, count to 10...


Dude, I couldn't do it in bash either off the top of my head. But its pretty blatently obvious that thats what you're going to need to do. You're trying to give him credit for not just typing out his assignment, I wouldn't give him that.

If he had honestly thought about it, and askes "Hey, how do I get the current date in bash?" or "hey, I am having trouble putting the user input into the same format as the date output" I might be a little more willing to help.

Long story short, I am done doing people's homework for them, I know I have answered obviuos homework questions in the past, but no more. You have a complex, specific question that came up durring your homework, fine, but questions like this will not get answers from me.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.