[mdlug] Extracting the day of the Week in BASH

Aaron Kulkis akulkis3 at hotpop.com
Fri Mar 9 16:35:31 EST 2007


Robert Adkins wrote:
>     My Google-Fu seems to be composed of weak sauce today.
> 
>     I am rewriting some scripts and due to the nature of what they do, I 
> would be best served to be able to pull up the actual name of the day in 
> order to properly organize the final resting place of some data.
> 
>     Anyone know either the variable that returns the actual day of the 
> week or a very short script to extract the day of the week?

Uh, just use the date command

VARIABLE=`some_command`

prints $VARIABLE # produces the output of the command



That, in combination with "man date"
should give you everything you need to know





More information about the mdlug mailing list