Skip to content

Instantly share code, notes, and snippets.

@funasoul
Created April 23, 2018 06:54
Show Gist options
  • Save funasoul/2c3c5c45e92cbfb575c07044ba38787b to your computer and use it in GitHub Desktop.
Save funasoul/2c3c5c45e92cbfb575c07044ba38787b to your computer and use it in GitHub Desktop.
get current nendo
get_nendo() {
foreach i ({0..11}) [ ~ ]
local lmonth=`date -v-${i}m '+%m'`
if [ $lmonth = "04" ]; then
local nendo=`date -v-${i}m '+%Y'`
fi
end
echo "$nendo"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment