I've been having a problem the last six months or so when combining searches in bash. The exact example is related to Python programming but would apply to any kind of detection/manipulation.
Suppose I want a list of all Python files in the directory where I am. This is easy:
find . -name '*.py'
Now, suppose I'm only interested in those Python files which contain the string "psycopg", e.g. because I want to transition from the old PostgreSQL access library psycopg to psycopg2. Still easy enough:
grep -l psycopg `find . -name '*.py'`
Now, suppose I want to do a full list of these files to inspect their date stamps to see when I last touched them. I could also wish to open them in gedit, but let's stick to the list:
ls -l `!!`
which expands to
ls -l `grep -l psycopg `find . -name '*.py'``
Now, what happens? Answer: Nothing. The bash prompt just hangs. Why is that? This may be a wrong way of doing things, but it used to work. I'm pretty sure it worked pre- Ubuntu 10.10 or 10.04.