[Bug 1055766] Re: grep -R doesn't automatically search amazon
Stuart Prescott
1055766 at bugs.launchpad.net
Thu Sep 27 15:58:34 UTC 2012
It would be shortsighted to do this only for grep.
A better approach would be to set PROMPT_COMMAND for the shell in
/etc/bash.bashrc to an appropriate shell function. The last command
executed is available as `history 1` in that handler:
--- bash.bashrc.orig 2012-09-27 16:52:30.452001532 +0100
+++ bash.bashrc 2012-09-27 16:54:24.312515801 +0100
@@ -53,3 +53,6 @@
fi
}
fi
+
+PROMPT_COMMAND='/usr/lib/ubuntu-amazon/prompthandler "$(history 1)"'
+
The handler can then work out what sort of output the user really wanted
to see in their shell based on the command given and also the arguments.
Commands like "nslookup", "dig" and "hosts" could offer registration
deals from GoDaddy. Commands like "passwd" could offer to sell the user
books on managing security policies. Commands like "vlc", "mplayer"
could could sell videos and music.
Communicating the command and arguments to an external server would
presumably be necessary, but I can't imagine anyone objecting to that.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to command-not-found in Ubuntu.
https://bugs.launchpad.net/bugs/1055766
Title:
grep -R doesn't automatically search amazon
Status in Ayatana Design:
Invalid
Status in “command-not-found” package in Ubuntu:
Invalid
Status in “gnome-terminal” package in Ubuntu:
Invalid
Bug description:
Dear "root owning" overlords,
When using grep recursively I only get local results:
grep -R fish_t /home/noob/fish_game/*
/home/noob/fish_game/fish.h: struct fish_t {
/home/noob/fish_game/fish.c: struct fish_t eric_the_ fish;
or worse:
grep -R shark_t /home/noob/fish_game/*
/home/noob/fish_game/fish.h: struct shark_t {
/home/noob/fish_game/fish.c: struct shark_t_t mark_sw;
I declare this a bug for two reasons:
1. The output is boring.
2. The terminal has more than 2 lines!!! It's an unefficient use of my screenspace.
I believe the reason for this is that the grep command only searches
locally for things I am actually looking for, I kind of expect the
results I get from my codebase and as such it removes any sense of
mystery or something new and exciting to spice up my dull geek
existence. That's boring, grep -R should also search amazon, so I get
more exciting results such as:
Shark Season 1 Starring Steven Eckholdt, Nora Dunn, Patrick Fabian, et al.
Amazon Instant Video
to buy episodes: $1.99
to buy season: $34.99 ($1.59 per episode)
Watch instantly on your PC, Mac, compatible TV or device.
2.
Product Details
See Color & Size Options
NHL San Jose Sharks Primary Logo T-Shirt Men's by Reebok
$16.95 - $19.99
new from $16.95
(1)
Eligible for FREE Super Saver Shipping.
3.
Product Details
See Size Options
Shark Week Girls T-Shirt by Hot Topic
$22.50
See all 9,755 results
"struct shark_t" (See all 1,583 results)
1.
Product Details
See Size Options
D:fi D:struct Pliable Molding Creme by D:Fi
$23.50 $17.05 ($11.37/100 g)
new from $10.50
Only 7 left in stock - order soon.
(35)
Eligible for FREE Super Saver Shipping.
2.
Product Details
Take 'N' Play Anywhere Activities Activity Tin - Robo-struct by Patch Products
$11.99 $8.77
new from $3.99
Order in the next 1 hour and get it by Tuesday, Sep 25.
Only 12 left in stock - order soon.
(1)
Eligible for FREE Super Saver Shipping.
Manufacturer recommended age: 4 - 9 Years
3.
Product Details
d:fi d:struct 2.65 oz by AMERICAN CREW
This is less dull and also maximises the use of my terminal and hence
increases my productivity.
Please can you change the grep warez to have this feature, and just
install it on my machine while I'm down the pub, after all you do
"erm, have root", so it should be easy for you to do :-)
Thanks Ubuntu devs!!!
Sent from my Unity device, (which is why it took several glacial ages
and a couple of eras to get it done)
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gnome-terminal 3.0.1-0ubuntu3
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic i686
ApportVersion: 1.23-0ubuntu3
Architecture: i386
Date: Mon Sep 24 22:20:29 2012
ExecutablePath: /usr/bin/gnome-terminal
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
SourcePackage: gnome-terminal
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ayatana-design/+bug/1055766/+subscriptions
More information about the foundations-bugs
mailing list