>Is there a way to pass a variable to the `date` function or another
>function that would return a specific value based upon the format I
>request?
>Ex.
> If I pass "8" I would want the function to return "Aug" for August
> If I pass "09072000" I want `Thursday` returned.
>so on and so forth.
This is easy using mktime
(http://www.interlog.com/~john/technogeek/source/mktime):
mktime -m 8 -F %b
mktime -m 09 -d 07 -y 2000 -F %A
or GNU's implementation of date
(mirrors of ftp://ftp.gnu.org/gnu/sh-utils/):
date -d 8/1 +%b
date -d '2000-09-07' +%A
How to go about generalizing the mktime example is, I think,
clear enough; the GNU date version is probably less obvious,
so I'll show it:
date -d "$month/1" +%b
date -d "$year-$month-$day" +%A
As to the magic "%b" and "%A" formats --- I'll leave you to
the documentation.
--Ken Pizzini