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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: @, a self modifying shell script/swiss army knife

2 点作者 irrationalidiom超过 13 年前

1 comment

fexl超过 13 年前
Clever concept, and it really shows off a lot of shell techniques in one place. The self-modifying aspect is fun to study (e.g. external-add, ext_insert), and the meta functions are interesting too (e.g. require). I may find this useful sometime, and in the meantime it makes me smile.<p>In my own small way, I too have used self-modify shell scripts, though nothing as far-reaching as what you've done. When I write C code, I use a "build" script instead of "make":<p><a href="https://github.com/chkoreff/Fexl/blob/master/src/build" rel="nofollow">https://github.com/chkoreff/Fexl/blob/master/src/build</a><p>(Never mind Fexl itself, I'm just sharing the build script here.)<p>The build script analyzes all the .c files in the current directory and automatically creates another "build" script in the ../obj directory. It then runs ../obj/build. But the next time you run it, it sees that ../obj/build already exists, so it doesn't need to analyze the .c files again.<p>Again, it's nothing quite like what you've done, but it just illustrates how fun and useful self-modifying shell scripts can be.