-
Notifications
You must be signed in to change notification settings - Fork 1
/
postscript.html
40 lines (38 loc) · 6.28 KB
/
postscript.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
id: postscript
layout: chapter
chapter: 5
title: 译后记
published: true
---
<section>
<div class="container">
<p>
最近很多时间都花在翻译部署这份指南上,虽然名为 <strong>bash</strong> 指南,但 bash 本身既不是我做这些工作的出发点也不是最终的落脚点,而是最近理解计算机和编程的载体。只是恰好基于它,这份指南的作者帮我厘清了许多经常出现在视野范围内却始终晕晕乎的概念;同时,作者头脑犀利到简直性感,讲解漂亮近乎表演,具体讲的是 bash 或是其他,反倒次等重要了。如此说来好像不把 bash 当回事,也不是。我对学习与使用 Linux 系统是有执念的,bash 自然就绕不过去,四篇指南翻译完,也觉得熟悉亲近起来。这不,又要专门写一篇后记来为它发声。</p>
<p>
作为一个初入计算机领域的人,面前必有群山般的陌生概念在等着,但如果眼不见倒也心不烦,麻烦的是那些已多次照面但未深交于是始终面目模糊的概念。我之所以会搜索、阅读、最终翻译这份指南,起因就是 <strong>PATH</strong> 。不记得已是第几次,又去搜索如何在 Linux 中向环境变量 <code>PATH</code> 中增加新的路径,搜索引擎都比我记性好,曾经打开过的页面还特别标红显示,自己却终于忍无可忍,下定决心要好好认识一番,于是就发现了 <strong><a href="https://guide.bash.academy/">The Bash Guide</a></strong> 。稍作阅读就直觉作者出手不凡:快刀斩乱麻,干净利落。
</p>
<p>
推荐大家直接到 <a href="https://4bashguide.codelab.club/inception/?=%E8%BF%99%E9%87%8C%E5%88%B0%E5%BA%95%E6%98%AF%E6%80%8E%E4%B9%88%E4%B8%80%E5%9B%9E%E4%BA%8B%EF%BC%9F%E6%96%87%E6%9C%AC%EF%BC%8C%E7%BB%88%E7%AB%AF%EF%BC%8Cbash%EF%BC%8C%E7%A8%8B%E5%BA%8F%EF%BC%8C%E8%BE%93%E5%85%A5%EF%BC%8C%E8%BE%93%E5%87%BA%EF%BC%81#h2.2">开篇中段</a>,看看作者 <a href="https://www.lhunath.com"> lhunath (Maarten Billemont)</a>如何图文结合梳理 <em>bash</em>、<em>shell</em>、<em>终端</em> 等概念间的关系,以及 <a href="https://4bashguide.codelab.club/expansions/#toc10">变量与扩展篇</a> 中,对 <em>环境</em> 概念的讲解,这些都是正中我要害印象犹为深刻的部分。不过,下面想特别多说两句的是一个非常不起眼的小 <strong>x</strong>。
</p>
<p>
首先请看一眼下方黑色方框中的这些字符:
</p>
<pre lang="bash">
<span class="prompt">$ </span><kbd>chmod +x hello.txt</kbd><em>将 hello.txt 标识为可被执行(e<strong>x</strong>ecutable)的程序</em>
<span class="prompt">$ </span><kbd>./hello.txt</kbd><em>让 bash 启动 hello.txt 程序</em>
</pre>
<p>
请问你有看到我说的小 <strong>x</strong> 吗?
</p>
<p>
如果没有,请先找到位于黑框内右上方的 <em>(executable)</em> ,再仔细看括号内的第二个字母。若将作者的头脑比作剑,那么刃就落在这不起眼的 <strong>粗体 x</strong> 上,锋利到几乎要伤人。前几次阅读时我根本没看到,也难怪,<a href="http://127.0.0.1:4000/commands/?=%E6%88%91%E8%A6%81%E5%A6%82%E4%BD%95%E5%90%91_bash_%E5%8F%91%E9%80%81%E5%91%BD%E4%BB%A4%EF%BC%9F#p1.2.0_9">命令与参数</a> 这篇文档有上万个字符,这里只是一条 bash 示例命令的注释中的一个字符而已,命令本身都不是重点,更别提它。在我不经意瞄到时,最初完全没反应过来,只是因为瞥到了,就瞬间纳闷了一下为什么要加粗单词中的某个字母,等再看到前面命令中的 <code>+x</code>,终于心领神会。作者在前后文中根本都没有提过 <code>+x</code> 对应的是单词 “executable” 中的 <strong>x</strong>,只是如上所示的这样,微微加粗了 <strong>x</strong>,你看到就看到了,没看到也就过了,就像我也是几次之后才无意间瞄到。使用 <code>chmod +x</code> 命令将某个文件设置为可执行的程序,这个操作我在 Linux 系统中也重复过多次了,但从来不曾想 x 表示什么,也没想到它有意义,并不是随意选的字母,而作者对内容的控制就这样结结实实落在一个字符上。或许是我技术小白少见多怪,反正那天晚上发现这个小 <strong>x</strong> 的时候,激动难抑,作者简直不留丝毫余地,绝了。
</p>
<p>
虽然这是指南不是书,但它的确让我想起卡夫卡关于读什么书的那句名言,<em>“所谓书,必须是砍向我们内心冰封大海的斧头”。</em> 这样的表达不知道看起来会不会显得极端,但并不觉得自己夸张,主要是作者的风格、态度以及事情做成的样子都朝向极致。学习翻译的过程中,除了熟悉 bash 的用法,廓清远近相关的概念,还内化了作者拆解、讲述编程语言的结构框架,甚至写作方式。基于 bash 语言的设计,心中不禁就生发出横向对 python 与 smalltalk 的好奇,在结构、设计上,什么是相似的,哪里是不同的? Bash 的各种扩展运算符确实很强大,但也真不好记,其他语言有这些吗?如果有,会更好记吗;如果没有,那类似的功能又是怎样实现的?在变量部分,作者着力讲解了环境变量的概念,这里不同层级进程间的继承关系看起来和面向对象中的继承关系很像呀,真的相似吗?还有 CLI vs GUI 的老问题。学习就这样在旧问题解决与新问题生发的过程中波动向前。
</p>
<p>
推荐大家抽点时间阅读这份指南,不是因为自己翻译了就要说它好,翻译只是个人选择的学习途径,如果可以,更希望大家都去阅读 <a href="https://guide.bash.academy/">英文原文</a>。只要是对—— Linux、命令行、bash 、编程语言、如何向他人讲解编程、如何写作技术文档/教程、或是头脑可以多犀利——任一话题感兴趣的人,我想都不会失望的,也欢迎大家来<a href="https://discuss.codelab.club/"> CodeLab 论坛</a> 中讨论交流。
</p>
</div>
</section>