Last active
December 14, 2015 23:39
-
-
Save shiraji/5167452 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#対象の曜日を指定。0が日曜日。 | |
targetDay=2 | |
#曜日取得 | |
day=`date +%w` | |
#対象の曜日までの日数 | |
numOfdays=`expr $targetDay - $day` | |
#対象の日付を取得 | |
date=`date -d "$numOfdays days" +"%Y-%m-%d"` | |
echo $date |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment