•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 375,202 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,379 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser:
Views: 737 | Replies: 3
![]() |
•
•
Join Date: Aug 2007
Posts: 26
Reputation:
Rep Power: 1
Solved Threads: 0
Can any one guie me how to find yesterday's date (taking care of the leap years as well)in the format yymmdd using a shell script. Regards.
The gnu version of the "date" command (as used in linux/cygwin) has this functionality built in already.
If you are using linux you can simply use
See man date for more details.
If you are using linux you can simply use
date --date=yesterday +%y%m%d
See man date for more details.
Last edited by blater : May 8th, 2008 at 8:11 am.
•
•
Join Date: Aug 2007
Posts: 26
Reputation:
Rep Power: 1
Solved Threads: 0
Thanks Blater. It worked.
•
•
Join Date: Oct 2007
Posts: 247
Reputation:
Rep Power: 1
Solved Threads: 26
Hey there,
If you're interested, just for kicks, here's the long convoluted way to do it
http://linuxshellaccount.blogspot.co...to-remind.html
Cheers,
Mike
If you're interested, just for kicks, here's the long convoluted way to do it

http://linuxshellaccount.blogspot.co...to-remind.html
Cheers,
Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
Similar Threads
- Ay up DMR! Still got about:blank after doing everything! (Viruses, Spyware and other Nasties)
Other Threads in the Shell Scripting Forum
- Previous Thread: CopyRight symbol printing using shell script
- Next Thread: Sending email from a shell script


Linear Mode