Unicode is extremely well integrated into MacOSX. Access to the full repertoire of Unicode Characters is available system wide. This makes possible the use of International Languages and specialist characters, such as, mathematical symbols.
These notes are an exploration of Unicode in the bash shell of MacOSX 10.5 (Leopard). I have mapped some of the basic bash commands to Chinese and Symbol Unicode Characters. Below is the transcript of my bash terminal session. Even if you cannot read Chinese, You may be able to deduce what I am doing from my terminal session transcript.
苹果电脑 ~ : 妈 我的目录
苹果电脑 ~ : 茶 我的目录
苹果电脑 我的目录 : 丽
苹果电脑 我的目录 : 头 文档一 文档二 文档三
苹果电脑 我的目录 : 丽
文档一 文档三 文档二
苹果电脑 我的目录 : 词 > 文档四
一
二
三
四
五
六
苹果电脑 我的目录 : 词 文档四
一
二
三
四
五
六
苹果电脑 我的目录 : 丽
文档一 文档三 文档二 文档四
苹果电脑 我的目录 : ⇉ 文档四 文档五
苹果电脑 我的目录 : 丽
文档一 文档三 文档二 文档五 文档四
苹果电脑 我的目录 : → 文档一 文档六
苹果电脑 我的目录 : 丽
文档三 文档二 文档五 文档六 文档四
苹果电脑 我的目录 :
So how did I do it?
First, I setup the bash system variable PS1, which contains the prompt string. PS1='苹果电脑 \W : '
苹果电脑 means Apple Computer and \W will display the current directory. I used Apple's Terminal App and in Preferences setup PS1='苹果电脑 \W : ' in the "Run Command" box in Shell preferences. You will also need to
ensure that the Character encoding for Terminal is set to Unicode (UTF-8).
I then set up some aliases to map bash commands to unicode characters, as follows:
alias 妈=mkdir
alias 头=touch
alias 丽=ls
alias 茶=cd
alias 词=cat
alias ⇉=cp
alias →=mv
My choices of Chinese characters for the bash commands was arbitrary. I just used the first letter of each bash command and then used a Chinese Character that begins with that letter. 目录 and 文档 are meaningful. 目录 means directory and 文档 means file.
Unicode bash opens up many possibilities for Internationalization, Customization, Studies and Experiments. By way of example, lets take my mapping "alias 丽=ls". 丽 means beautiful and the pinyin romanized form is lì, so, lì can be associated with LIst. Unix commands are generally cryptic and not easily remembered. I posit that lì/beautiful is memorable.