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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A Bourne-style shell built from scratch in 35 minutes [video]

197 点作者 gary_bernhardt将近 8 年前

15 条评论

notheguyouthink超过 7 年前
On this note, I need to build my own Terminal multiplexer - does anyone have a favorite primer of theirs for all the escape codes? Not only do I need to use them myself, but I need to handle them of child processes to restrict term sizes etc.<p>I can Google like ya&#x27;ll - I&#x27;m just asking if there are any favorite resources :)<p>Thanks
评论 #15148979 未加载
评论 #15149646 未加载
评论 #15148770 未加载
评论 #15149245 未加载
评论 #15150773 未加载
kazinator超过 7 年前
Then 35 weeks to get POSIX job control, pipes, handling signals and whatnot. 35 years to find the last bug.
评论 #15152700 未加载
评论 #15149374 未加载
评论 #15154820 未加载
sigjuice超过 7 年前
<i>It supports (1) running commands with arbitrarily many arguments</i><p>Wouldn&#x27;t the size of the arguments be limited by sysconf(_SC_ARG_MAX) as explained here? <a href="http:&#x2F;&#x2F;man7.org&#x2F;linux&#x2F;man-pages&#x2F;man2&#x2F;execve.2.html" rel="nofollow">http:&#x2F;&#x2F;man7.org&#x2F;linux&#x2F;man-pages&#x2F;man2&#x2F;execve.2.html</a><p>PS: Is the code available somewhere? I can&#x27;t play the video on Firefox on CentOS 6.
moomin超过 7 年前
The Bourne Shell was, in my opinion, the worst of Robert Ludlum&#x27;s books.
amelius超过 7 年前
By the way, IMHO much of the ugliness of shells comes from the requirement that simple filenames are to be used without additional escape characters. I think we should ditch that requirement.
评论 #15150433 未加载
评论 #15150234 未加载
amelius超过 7 年前
Only typing the man page of the Bourne shell will take at least a few days.
评论 #15152228 未加载
teddyh超过 7 年前
There is more to writing a shell than simply reading commands and executing them after fork()ing. TTY handling must be done right¹ and interrupt and signal handling is rather tricky to get right as well².<p>(Not to mention, of course, that a Unix shell is very cumbersome to use without pipes and redirection. EDIT: Pipes are implemented, but not redirection?)<p>1. <a href="http:&#x2F;&#x2F;www.linusakesson.net&#x2F;programming&#x2F;tty&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.linusakesson.net&#x2F;programming&#x2F;tty&#x2F;</a><p>2. <a href="https:&#x2F;&#x2F;www.cons.org&#x2F;cracauer&#x2F;sigint.html" rel="nofollow">https:&#x2F;&#x2F;www.cons.org&#x2F;cracauer&#x2F;sigint.html</a>
评论 #15148807 未加载
评论 #15149148 未加载
sillysaurus3超过 7 年前
I&#x27;m surprised there are no comments about the video itself.<p>How was this video made? Imagine trying to make it. What would you do? You need to write the code, but do you do it before or after you write the script? Or do you write the script after you write up the code so you know how to produce it?<p>Everything flows so smoothly. It&#x27;s mesmerizing to watch. It&#x27;s like code appears as fast as he can talk. But in a natural way, where it seems like it&#x27;s typed as he&#x27;s talking. But he certainly isn&#x27;t typing it in realtime.<p>I&#x27;d like to make videos like this too, so I&#x27;d like to learn more about how to produce one.
评论 #15152342 未加载
评论 #15152559 未加载
评论 #15152109 未加载
pooonthis超过 7 年前
Such negative Nellies. This is why I don&#x27;t publish anymore. You try to teach people something fun, and show people you can do quite a lot with very little. But it&#x27;s nothing but criticism, and none of it constructive.
评论 #15151493 未加载
评论 #15150561 未加载
评论 #15150722 未加载
reaperducer超过 7 年前
Was expecting more guns, car chases, exotic city backgrounds, and slightly-above-average women from the new Bourne shell. Turns out it&#x27;s just a command line interpreter. Two stars.
评论 #15149206 未加载
评论 #15151174 未加载
评论 #15150900 未加载
评论 #15151211 未加载
albedoa超过 7 年前
Will this video eventually be paywall&#x27;d as well?
评论 #15152410 未加载
raoulj超过 7 年前
I&#x27;m impressed that destroyallsoftware is able to put their screencast library behind a $30&#x2F;mo paywall. Am I the only one who thinks that&#x27;s high?
评论 #15152451 未加载
评论 #15152178 未加载
评论 #15152770 未加载
Scarbutt超过 7 年前
But &#x27;ls&#x27; already has built-in sorting.
Fiahil超过 7 年前
I was so disappointed that they chose Ruby. I would have been impressed if they had chosen bare C and still manage to build it under 35 minutes.
评论 #15151087 未加载
评论 #15150849 未加载
randrews超过 7 年前
This was one of the projects in my Unix class in college. And yeah, it took about 35 minutes. :)