2009-05-31 2 views
0

메모에 NB라는 단어를 사용하는 행 목록을 작성하려고합니다.Firefox에서 Ack의 출력을 열 수 없습니다.

의사 코드 그러나

open -a Firefox `ack -a NB` 

, 나는 파이어 폭스 터미널에서 매개 변수를 이해 할 수 없습니다. Ack의 출력은 텍스트 파일이므로 Firefox로 어떻게 든 리디렉션되어야합니다.

내가 실패 내가 파이어 폭스의 주소 표시 줄에 얻을

open "http://`ack -a NB`" 

실행

파이어 폭스는 명령 줄에서 URL을 취
http://[1/;32mACK-grep/.todo%1B%5B0m:3:%20%20%20%20%20%20%20%20to%20find%20%1B%5B30;43mNB%1B%5B0ms%20use%20ack%20-a%20%1B%5B30;43mNB%1B%5B0m%1B%5B0m%1B%5BK%0A%1B%5B1;32mAPI/.todo%1B%5B0m:5:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%1B%5B0m%1B%5BK%0A%1B%5B1;32mAWK/.todo%1B%5B0m:5:%20%20%20%20%20%20%20%20%20%20%20%20Changing%20the%20field%20separator.%20%1B%5B30;43mNB%1B%5B0m%20do%20non%20confuse%20the%20field%20separator%20to%20small%20f%20i.e.%20-f%20for%20the%20name%20of%20a%20script%20file%1B%5B0m%1B%5BK%0A%1B%5B1;32mBg-disown/.todo%1B%5B0m:12:%1B%5B30;43mNB%1B%5B0m%20disowning%20is%20a%20one%20way%20street.%20There%20is%20no%20way%20to%20reattach%20as%20with%20screen.%1B%5B0m%1B%5BK%0A%1B%5B1;32mC-C++/Getting-started/.todo%1B%5B0m:6:%1B%5B30;43mNB%1B%5B0m%20endl%20indicates%20line%20output.%1B%5B0m%1B%5BK%0A%1B%5B1;32mC-C++/Getting-started/.todo%1B%5B0m:38:%1B%5B30;43mNB%1B%5B0m%20stdexcept%20allows%20standard%20exceptions%1B%5B0m%1B%5BK%0A%1B%5B1;32mC-C++/Getting-started/.todo%1B%5B0m:45:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20ensure%20that%20the%20user%27s%20given%20value%20is%20not%20eg%20string%20when%20the%20program%20wants%20a%20figure%1B%5B0m%1B%5BK%0A%1B%5B1;32mC-C++/Getting-started/.todo%1B%5B0m:63:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20&num%20is%20same%20as%20num&%1B%5B0m%1B%5BK%0A%1B%5B1;32mC-C++/Special-facts/.todo%1B%5B0m:3:%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20**in%20C++:%20http://stackoverflow.com/questions/644981/what-is-in-c/644989%23644989%1B%5B0m%1B%5BK%0A%1B%5B1;32mCompilers/3goals/.todo%1B%5B0m:6:%1B%5B30;43mNB%1B%5B0m%20parsing%20alone%20solves%20most%20of%20the%20compiler%20related%20problems%1B%5B0m%1B%5BK%0A%1B%5B1;32mCompilers/3goals/.todo%1B%5B0m:12:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%1B%5B0m%1B%5BK%0A%1B%5B1;32mDjango/.todo%1B%5B0m:10:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20Pinar%1B%5B0m%1B%5BK%0A%1B%5B1;32mDjango/Django-admin.py/.todo%1B%5B0m:9:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20install%20the%20tab%20completion%1B%5B0m%1B%5BK%0A%1B%5B1;32mDjango/GettingStarted/Basics-manage.py-startapp/.todo%1B%5B0m:7:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20__init__.py%20is%20also%20created%1B%5B0m%1B%5BK%0A%1B%5B1;32mDjango/GettingStarted/tempaltetags/.todo%1B%5B0m:11:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20tests%1B%5B0m%1B%5BK%0A%1B%5B1;32mED-SED/SED/Flags/.todo%1B%5B0m:5:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20combine%20statements%1B%5B0m%1B%5BK%0A%1B%5B1;32mED-SED/SED/Getting-started/.todo%1B%5B0m:26:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20swaps%20the%20words%1B%5B0m%1B%5BK%0A%1B%5B1;32mED-SED/SED/Getting-started/.todo%1B%5B0m:35:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20the%20use%20of%20%5C1,%20which%20takes%20the%201st%20match%1B%5B0m%1B%5BK%0A%1B%5B1;32mED-SED/SED/Getting-started/.todo%1B%5B0m:41:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20add%20brackets%20around%20each%20matches%1B%5B0m%1B%5BK%0A%1B%5B1;32mED-SED/SED/Getting-started/.todo%1B%5B0m:51:%20%20%20%20%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20remove%20duplicates%1B%5B0m%1B%5BK%0A%1B%5B1;32mED-SED/SED/Matches/.todo%1B%5B0m:3:%20%20%20%20%20%20%20%20%1B%5B30;43mNB%1B%5B0m%20sed%20-ie%20%27s/SO/so%27%20app.yaml%1B%5B0m%1B%5BK%0A%1B%5B1;32mEmacs/.todo%1B%5B0m:21:%1B%5B30;43mNB%1B%5B0m%20same%20commands%20as%20in%20terminal%1B%5B0m%1B%5BK%0ABinary%20file%20Emacs/keybindings/emacs-keywords.png%20matches%0A%1B%5 

답변

1

; open은 파일을받습니다. ack의 stdout은 URL (또는 파일)이 아닙니다. 대신 ack의 출력을 파일에 쓰고 firefox를 열어야합니다. 당신이이 작업을 수행 할 이유

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

는 잘 모르겠어요,하지만 작동합니다. 이 방법으로 색상을 얻지 못할 수도 있습니다. ack는 HTML AFAIK를 작성하지 않습니다.

+0

@derobert : 어떻게 든 터미널에서 인코딩을 선택할 수 있습니까? - 출력을 얻습니다. 예 : [1; 32mAWK/.todo [0m : 5 –

+1

--nocolor 옵션을 사용해보십시오. 그것은 리다이렉트가있는 디폴트가되어야하지만 누가 알 수 있는지. (당신이보고있는 이상한 것들은 색상 코드입니다.) – derobert

+0

답장을 보내 주셔서 감사합니다! –

관련 문제