Ask Your Question
1

Grepping in specific ROS packages?

asked 2011-03-28 08:17:21 -0600

Julius gravatar image

Hello, I want to quickly grep for keywords in a specific ROS package. I have installed and tried recoll as described in rosgrep wiki page but I am not satisfied as it does not follow standard grep syntax and does not provide context for the keywords.

I could not find an appropriate "Tools" component in trac to post a feature request, so I'll ask the question here what's the best way to grep when you're looking for context and a guaranteed synchronized search result?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-03-28 08:20:28 -0600

Julius gravatar image

I'll give one possible answer myself. Creating my own 'rosgrep' script, this exactly matches my requirements.

 #!/bin/bash
 pkg=$(rospack find $1)
 shift
 grep --exclude-dir=\.svn --exclude-dir=bin --exclude-dir=build --exclude-dir=lib $* -r $pkg --color=always

Resulting in

image description

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2011-03-28 08:17:21 -0600

Seen: 154 times

Last updated: Mar 28 '11