🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bc.unix
Article #71

Re: Need help with script

#71
From: Rick Younie
Date: Sun, 08 Dec 2002 05:05
18 lines
1536 bytes
tom <moodade@optonline.net> wrote:
> I'm trying to write a script that will return the last business day's 
> date in mmddyy format.
> Does anybody know of an easy way to do this.
> Im having trouble accounting for Monday's are easy, I just subtract 3 
> and get friday's date, but Im having trouble with the beginning of the 
> month being that all months don't have the same amount of days.  any 
> help would be greatly appreciated.

Now that I've actually read the question..

if it's monday
  date -d "3 days ago" +%d%m%y
else
  date -d yesterday +%d%m%y

Rick
-- 
Technical Details
Message-ID: <asujtv$fub$1@luna.vcn.bc.ca>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news-feed.riddles.org.uk!lios!news.gweep.ca!nntp.cs.ubc.ca!nntp.itservices.ubc.ca!news.vcn.bc.ca!not-for-mail
References: <3DDC58AE.6000305@optonline.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114424,6ad515f0eb81bf9
X-Google-Attributes: gid114424,public
X-Google-ArrivalTime: 2002-12-07 21:05:16 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news-feed.riddles.org.uk!lios!news.gweep.ca!nntp.cs.ubc.ca!nntp.itservices.ubc.ca!news.vcn.bc.ca!not-for-mail
From: Rick Younie <rick@vcn.bc.ca>
Newsgroups: bc.unix
Subject: Re: Need help with script
Date: Sun, 8 Dec 2002 05:05:03 +0000 (UTC)
Organization: Vancouver Community Network
Lines: 18
Message-ID: <asujtv$fub$1@luna.vcn.bc.ca>
References: <3DDC58AE.6000305@optonline.net>
NNTP-Posting-Host: felix.vcn.bc.ca
X-Trace: luna.vcn.bc.ca 1039323903 16331 207.102.64.2 (8 Dec 2002 05:05:03 GMT)
X-Complaints-To: abuse@vcn.bc.ca
NNTP-Posting-Date: Sun, 8 Dec 2002 05:05:03 +0000 (UTC)
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))