Posts

《漢書·律曆志》筆記(1):中國傳統曆法的特點與《漢書·律曆志》的主要內容

中國傳統曆法的特點 中國傳統曆法有以下這些主要特點: 用干支記錄日期 以朔望月來確定月份 以朔望月與回歸年的配合來確定一年的長度,也就是在哪些年份設置閏月,閏月設置在哪個月份 除了年月日之外,還有完全由回歸年決定的二十四節氣 除了編算年月日、節氣之外,還要推算五大行星的運行 以下就對這些特點進行詳細說明。
2025-12-24
11 min read

Variables and string in the shell

I have not really grasped the tricky variable use and string operations in the shell, and this post is a cheatsheet of the common variable and string operations in the shell. Variables Assigning values to variables, note that = immediately follows the variable name and it allows no space. variable='value' variable="value" variable=value There are several ways of calling a variable, by $variable, ${variable} and "$variable". The curly braces are useful when you need to clearly mark the boundary of the variable name. For example, $variableisvalue will not output the value of $variable since the shell interprets the name of the variable as variableisvalue. To tell the shell where the variable name ends, surround the variable name with curly braces ${variable}isvalue, which is not ambiguous to the shell.
2025-11-24
2 min read

說丁年

《文選》李陵《答蘇武書》:“丁年奉使。”李善注:“丁年,謂丁壯之年也。漢書曰:武留匈奴凡十九歲。始以強壯出,及還,鬢髮並白。”黃生《字詁義府合按》卷下“丁壯”:“漢書·高帝紀:‘丁壯若軍旅’,古丁、當同音,丁壯言其年正當壯時也。後語省,遂單呼爲丁,故民年二十成丁。李陵《答蘇武書》:‘丁年奉使’,正謂年在二十左右也。”李善讀丁年爲丁壯之年,而黃生說古代丁、當同音,並且指實丁年是二十成丁之年,也就是說蘇武奉使是在二十歲。說丁、當同音不確,下面再詳細討論;而說蘇武二十歲奉使,則是錯的。
2025-11-13
8 min read