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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

*nix command line apps should have a –json output flag

4 点作者 tlhunter将近 13 年前

2 条评论

rachelbythebay将近 13 年前
It seems like someone who runs enough pings to warrant this kind of parsing would be better served writing a service which does nothing but ping stuff. Then they can use whatever encoding method they want rather than trying to retrofit such things onto existing tools which are for humans.<p>It seems people want to wrap things and parse them rather than making the same basic library calls themselves. Note the "inspiration" part of this post: the author started parsing the output of iwlist instead of just making the requisite calls directly.<p>Oh, and don't derail this with a discussion of suid-ness required for raw sockets (ping) or whatever magic ioctls that an iwlist-alike would require. This applies to other things which can run as a normal user, too.
评论 #4080252 未加载
rcfox将近 13 年前
Or just pipe the output into a filter that outputs the json for you.
评论 #4079958 未加载
评论 #4079928 未加载
评论 #4079968 未加载