TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: To beat my impostor syndrome (and learn Bash), I read the RBENV GH repo

2 点作者 toomanyrichies大约 1 年前
What&#x27;s the first thing that happens when you type `bundle install` into the terminal and hit &quot;Enter&quot;?<p>Professionally, I work on a large Rails codebase with many contributors, and `bundle install` is one of the most common commands we find ourselves typing. I was frustrated that I didn&#x27;t know how this command worked under-the-hood. Since I&#x27;m a big believer that &quot;The best way to learn something is to explain it to someone else&quot;, I decided to blog about what I was learning, as I learned it.<p>Because I use RBENV to manage my Ruby version, the first file I encountered on this deep-dive was RBENV&#x27;s shim for the `bundle` command, which is written in Bash. From there, I moved on to the files for the various commands that RBENV&#x27;s API exposes, and things kind of snowballed from there.<p>Through consistent daily practice, eventually I worked my way through the entire RBENV codebase. I learned things like:<p>-What a shebang is<p>-What the `$PATH` variable is, and how it&#x27;s used<p>-How to read and modify UNIX&#x27;s file permissions<p>-What POSIX is<p>-How to use parameter expansion to succinctly modify variable values<p>-How to use command substitution to store the output of a command in a variable<p>-What shell options are, and how to set them with the `set` command<p>-How to use `export` to turn a shell variable into an environment variable, and what the difference is<p>-The difference between `exec` and forking, and when to use each one<p>-What a process is<p>Learning Bash was a great result from this process, but the biggest benefit was the slow transformation from thinking &quot;Maybe a 10x engineer could understand this code, but not me&quot; to &quot;Oh, <i>that&#x27;s</i> all this code does?&quot; My hope is that other people who similarly suffer from impostor syndrome will be inspired to repeat this process with a codebase that is relevant to them. I&#x27;m now looking forward to repeating this process on other seemingly intractable codebases, and growing my circle of competency even further.

暂无评论

暂无评论