- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Shell Script - Yesterday's date
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 08:33 AM
тАО11-28-2001 08:33 AM
Thanks,
Tracey
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 11:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 11:01 AM
тАО11-28-2001 11:01 AM
Re: Shell Script - Yesterday's date
http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x6901c7af36b7d5118ff10090279cd0f9,00.html
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 11:02 AM
тАО11-28-2001 11:02 AM
Re: Shell Script - Yesterday's date
typo 34 should be 23
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 11:03 AM
тАО11-28-2001 11:03 AM
Re: Shell Script - Yesterday's date
Try this:
YESTERDAY=$(caljd.sh $(caljd.sh -p 1))
echo "Yesterday = ${YESTERDAY}"
Use the attached caljd.sh
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 11:11 AM
тАО11-28-2001 11:11 AM
Re: Shell Script - Yesterday's date
Or you can take the simple route:
#!/bin/sh
today=`date +%d`
yesterday=`expr $today - 1`
echo $yesterday
Of course this may not be as efficient as the others listed above.
-Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 11:30 AM
тАО11-28-2001 11:30 AM
Re: Shell Script - Yesterday's date
DATE=`TZ=MET+24 date +%d`
echo $DATE
Good Luck,
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 01:15 PM
тАО11-28-2001 01:15 PM
Re: Shell Script - Yesterday's date
perl -e 'print scalar localtime (time -1*86400),"\n"' and you can replace the 1 with whatever number you want if you need more than one day ago.
Hope it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 01:22 PM
тАО11-28-2001 01:22 PM
Re: Shell Script - Yesterday's date
Thanks for the points, you pushed me over the top and presented me with what everyone says is the coolest hat to have. Thanx.
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2001 03:57 PM
тАО11-29-2001 03:57 PM
Re: Shell Script - Yesterday's date
let yesterday=`date +%d`-1
dl