Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

kachick/extoday

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

extoday

  • This repository is archived
  • No longer maintained

Description

Shell functions to get attributes around a day.

Usage

Setup

LANG=C; export LANG # recommend :)
. /path/lib/extoday.bash

Batch on specific days

if [ $(show_nth_week_this_month) = 4 ] && [ $(show_wtoday) = Mon ]; then
    # Run commands if script on Monday of "4th week" in current month
    # (it is not always on the "4th Monday")
    your_script
elif [ $(show_nth_wday_this_month) = 4 ] && [ $(show_wtoday) = Mon ]; then
    # Run commands if script on "4th Monday" in current month
fi

List Mondays for "4th week of the months" in next year

for n in $(seq 0 365); do
    date=$(date --date "$n day" '+%Y-%m-%d')

    if [ $(show_nth_week_in_month "$date") = 4 ] && [ $(show_wday "$date") = Mon ]; then
        echo "$date"
    fi
done

Requirements

Choose

  • bash

And

  • GNU/date

License

LGPL v2.1
Copyright (c) 2011 Kenichi Kamiya
See COPYING for further details.

About

Shell functions to get attributes around a day.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages