The amazon results are effectively inline with regular results (placed just after, but with the same appearance). There's no reason grep could not also list a few amazon products with URLs after the regular results.
This is absolutely the only way such a feature could be sanely realized, and it would require so many invasive changes it is absurd.
Off the top of my head you would need to patch glibc, all the major shells, probably half of coreutils, anything that daemonizes similar to nohup (including screen and tmux, god knows how many CPAN modules), ...
It could write the output to stderr. Or only write it if stdout is a terminal. Or create a new window that temporarily overlays the xterm running the command.
Yes, amazon-enabled dash and grep/find/whatever have different functionality. But that's a recent change. Previously, dash had exactly the same functionality. That's the entire point. You add a feature here, you add the same feature there.
So now grep prints advertisements if I have it print to a tty, but not if I have it print to a pipe that goes to a pager? Which I almost certainly would be doing if advertisements are pushing my output over 20 or so lines? That is your idea of usability? Brilliant, just brilliant. I suppose I shouldn't even bother to ask what happens if I have tty output being consumed by another program.
>Or create a new window that temporarily overlays the xterm running the command.
You have got to be kidding me. This is a joke.
>Previously, dash had exactly the same functionality
The exact same functionality of which? And I rather doubt that is true.
>You add a feature here, you add the same feature there.
No. No you do not. Not when there is standardized. And in this case the "here"/"there" relationship has not even been established for "ubuntu-dash"/grep, making this extra idiotic.
A lot of console apps dump extra data to stderr, sounds good to me. Especially because if you page the output in less the ads will stay on the screen after you're done :D
Well, aside from blowing the signal/noise ratio of stderr out of the water, I suppose it would be fairly entertaining at first to see log files get filled with advertisements.