I am working on a project on two different machines - one running Mac OSX 10.8.3, and one running Red Hat Enterprise Linux. On my Mac, I can do this:vim $(ls -R */*.@(h|cpp) */*/*.@(h|cpp))and everything works fine. On the Linux box, it fails. All of these work exactly as I expect:ls -R */*.@(h|cpp) */*/*.@(h|cpp)echo $(ls -R */*.@(h|cpp) */*/*.@(h|cpp))export myfilelist=$(ls -R */*.@(h|cpp) */*/*.@(h|cpp))echo $myfilelistBut vim $(ls -R */*.@(h|cpp) */*/*.@(h|cpp))produces a set of mangled filenames, e.g.^[[00m^[[00mevent_builder/include/eb_service.h^[[00m [New DIRECTORY]or:ls  1 %a   ^[[00m^[[00mevent_builder/include/eb_service.h^[[00m line 1  2      ^[[00mevent_builder/include/EventBuilder.h^[[00m line 0Does anyone know why?
starting vim with command substitution
bash;ls;wildcards;command substitution
You have an alias (or function) for ls that colorizes the output. What does type -a ls give you? Instead usevim $(command ls ...)However: don't parse lsTry shopt -s nullglob globstarprintf %s\n **/*.{h,cpp}