views:

66

answers:

1
+1  A: 

Firefox takes URLs on its command line; open takes files. ack's stdout is not a URL (or a file). Instead, you'll need to write ack's output to a file, and have firefox open that.

ack-grep -a NB > ~/ack-out.txt
open -a Firefox ~/ack-out.txt

I'm not sure why you want to do this, but that should work. Note that you probably won't get color this way; ack does not write HTML AFAIK.

derobert
@derobert: Can you choose the encoding somehow at the terminal? -- I get the output, for instance: [1;32mAWK/.todo[0m:5
Masi
Try the --nocolor option. That should be the default with a redirect, but who knows. (Those weird things you're seeing are the color codes)
derobert
Thank you for your answers!
Masi