Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

FubsyGamr

macrumors regular
Original poster
Sep 20, 2010
116
0
Hey guys;

I am here filling out an assignment sheet for my Intro to Unix class. Luckily, because I have a Mac, I am able to run all of the terminal commands without the need to go through some other program (like Putty).

Anywho, I'm having trouble on the very last one. The question asks us how to display the date, 100 days in the future. Our teacher told us up-front that this answer is not in the book, and that we would need to search in Google.

After searching, I found two different answers. The problem is, neither of them actually work on my Terminal. Just to confirm, I also logged into the same terminal that the rest of my classmates have to use (using Putty to connect to my school's terminal), and they don't work there, either.

So now, I come to you guys, hoping for some help!

Here's what I have found. Below I put what I typed into the terminal, and the resulting error message.

Code:
date -d "100 day"
Code:
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]

and

Code:
date --date='100 day'
Code:
date: illegal option -- -
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]

Thanks for any/all help!
 
Last edited:
Code:
man date

(Sorry, I would actually tell how to do it, but since it's a homework assignment you should find out yourself)
 
Hahaha wow do I feel dumb! Because our teacher told us it wasn't in the book, and to use Google, I never thought to check man.

I found it there.

Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.