Pages
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
My neovim setup (with Ghostty)
Last year, I switched from Sublime Text to Neovim and Neovim has proved to be very efficient. This post showcases my Neovim setup and some useful tips. I agree with Guilherme D. Garcia that multiple tools for multiple purposes (RStudio for R, Sublime Text for markdown and $LaTeX$, etc.) is far from perfect, and Neovim indeed provided an integrated way of dealing with all these purposes (markdown/$LaTeX$, R, Python, and many more). It also provides the incredible capabilities of the Vim arsenal.
2025-11-07
2 min read