News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

How to add grep command to the Tools menu

Started by jackhab, October 12, 2009, 11:39:24 AM

Previous topic - Next topic

jackhab

I need to extract several lines from active source file. I tried to add grep command to the Tools menu like this (I'm using dummy pattern for the test) :

Name: List ints
Executable: /usr/bin/grep
Parameters: '-e int' ${ACTIVE_EDITOR_FILENAME}

Launch tool hidden with standard output redirected


The tool fails with the following log:

Launching tool 'List ints': /usr/bin/grep '-e int' /media/backup/mylinux/projects/trunk/Manager/Main.cpp (in /media/backup/mylinux/projects/trunk/MrStreamManager)
stderr> execvp(/usr/bin/grep, -e int, /media/backup/mylinux/projects/trunk/Manager/Main.cpp) failed with error 2!
stderr>
stdout>
Tool execution terminated with status 255


What seems to be the problem here? Do I need some quoting tricks?

Thanks.



zabzonk

You don't want the quotes arou8nd the -e flag:

Name: List ints
Executable: /usr/bin/grep
Parameters: -e int ${ACTIVE_EDITOR_FILENAME}

jackhab

Still has the problem

execvp(/usr/bin/grep, -e, int, /media/backup/m...cpp) failed with error 2!

Jenna

Quote from: jackhab on October 12, 2009, 12:22:17 PM
Still has the problem

execvp(/usr/bin/grep, -e, int, /media/backup/m...cpp) failed with error 2!

Make sure grep is in /usr/bin !
On my system (debian) it is in /bin !

EDIT:
You do not need to use the absolute path, if grep is in your searchpath.

jackhab

U-N-B-E-L-I-E-V-A-B-L-E ! ! !

It is in /bin. I forgot to 'which grep'. Thank you so much, jens.