2026年7月30日 · 星期四
● 每日更新·改变自己
Eurekar·TOP
捕捉真实世界的英语信号
25信息来源
8,216精选文章
167单词卡片
18照片图片
全部6,477口语2,048免费395新闻1,599帖子1,379hackernews658tmz458techmeme456随笔323slashdot309外刊291arstechnica230techcrunch218Cards167simonwillison73动态69bloomberg54sethgodin43图片18youtube7
← 返回

空冒号在 shell 中不起作用,但还是使用它

2026-07-26 hackernews

← 上一篇返回列表下一篇 →

A shell colon does nothing. Use it anyway

空冒号在 shell 中不起作用,但还是使用它

HN 125 分 · 42 条评论 · 作者 olexsmir · 来源 refp.se · HN 讨论

【摘要】

The article highlights the power of the shell colon in streamlining script logic, specifically replacing multiple lines of argument validation with a single construct. This technique utilizes parameter expansion to check if variables are set or empty, exiting with an error if they are not.

⋯ 继续阅读请登录会员 ⋯

🔒

MEMBERS ONLY

这篇是会员专享内容,你看到的是预览段。

会员每天解锁 6000+ 篇真实英语素材——双语科技、口语、外刊、单卡,不设上限。

年会员 ¥365 —— 一天一块钱,续费一直能用。

了解会员 →

已是会员?点此登录解锁全文。

← 上一篇返回列表下一篇 →