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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

GNU grep 2.12 changes behavior of recursion options, breaks existing scripts

119 点作者 cschramm将近 13 年前

9 条评论

js2将近 13 年前
Here's the change and it's justification:<p><a href="http://git.savannah.gnu.org/cgit/grep.git/commit/?id=c6e3ea61d9f08aa0128a0eb13d31a2fbad376f99" rel="nofollow">http://git.savannah.gnu.org/cgit/grep.git/commit/?id=c6e3ea6...</a><p><i>Change -r to follow only command-line symlinks, and by default to read only devices named on the command line. This is a simple way to get a more-useful behavior when searching random directories; the idea is to use 'find' if you want something fancy. -R acts as before and gets a new alias --dereference-recursive.</i><p>Personally I think breaking compatibility for this change was a poor decision.
评论 #4296307 未加载
评论 #4298212 未加载
评论 #4297848 未加载
评论 #4299951 未加载
larrik将近 13 年前
The biggest problem I see is: who the heck would expect a .12 release to break compatibility in an ancient and solid piece of software?
评论 #4297449 未加载
buster将近 13 年前
Who thought it might be a good idea to break -r (most likely the most often used option) and use the old behaviour for -R?<p>Wouldn't it be better to atleast let -r behave like ever and change -R?<p>Anyone ever used -R here? :)
评论 #4296043 未加载
评论 #4295886 未加载
评论 #4295873 未加载
评论 #4295851 未加载
评论 #4295994 未加载
评论 #4300054 未加载
评论 #4297866 未加载
cschramm将近 13 年前
Another thought: Since rgrep is an alias for grep -r and grep -r has changed, the complete rgrep tool has changed and this can _not_ be fixed by using the "right" switch. Hence rgrep is useless for scripting now.
pooriaazimi将近 13 年前
This is a serious question: Why would you want to use plain old "grep" instead of "ack"[1]? Of course, other than the fact that it's on all machines. Why would you use it instrad of "ack" on your own machines? That's an honest question, I'm not starting a flamewar... The highlighting and filename/line# by default is the killer feature for me.<p>Edit: Come on. Downvotes for this? Honestly... It's HN, not StackOverflow. You don't mark questions as "off-topic" unless they're trolling...<p>[1]: <a href="http://betterthangrep.com" rel="nofollow">http://betterthangrep.com</a>
评论 #4297173 未加载
评论 #4297299 未加载
评论 #4297768 未加载
评论 #4296833 未加载
评论 #4299212 未加载
评论 #4297686 未加载
评论 #4299073 未加载
评论 #4297922 未加载
评论 #4299519 未加载
评论 #4298040 未加载
rwos将近 13 年前
It's funny how one of the relatively few design errors in Unix shells now indirectly comes back to haunt us. Recursing is built into pretty much every command that can handle multiple files - which very strongly suggests it should have been made a feature of glob (or the shell).<p>I think it's a bit sad that those "big-picture" features in unix are treated as if the were written in stone.
评论 #4299364 未加载
JoachimSchipper将近 13 年前
Remember: GNU is <i>not</i> UNIX.
m0skit0将近 13 年前
Backwards compatibility is an evil illness that sometimes must be broken. It's for the good of evolution. I praise engineers that make such decisions, even if they are unpopular.
评论 #4296108 未加载
评论 #4296075 未加载
评论 #4296168 未加载
评论 #4298421 未加载
snorkel将近 13 年前
I also decided that sed no longer supports regexes because I said so. And ls -l will now shows a list of print jobs instead of files because maybe that's what you meant. ... oh and ping no longer supports IPv4 because I want everyone to adopt IPv6 immediately because I said so.