Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grep nothing working for paths #104

Open
camAtGitHub opened this issue Apr 6, 2022 · 1 comment
Open

grep nothing working for paths #104

camAtGitHub opened this issue Apr 6, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@camAtGitHub
Copy link

camAtGitHub commented Apr 6, 2022

Hello,

its seems the grep command doesn't return results for paths that match.
If you imagine a layout like this:

/secrets/servers/server1-statename/root_password
/secrets/servers/server1-statename/tech_password
/secrets/servers/server2-statename/root_password
/secrets/servers/server2-statename/tech_password

You can see why being able to grep for 'server1' or 'statename' may be important.

My real example where I'm searching for 'syncthing'.

https://consul.acme.com /secret/> cd docker/vars
https://consul.acme.com /secret/docker/vars/> ls
production/
tnd/
https://consul.acme.com /secret/docker/vars/> ls production/
syncthing
https://consul.acme.com /secret/docker/vars/> grep synct
https://consul.acme.com /secret/docker/vars/> grep --keys synct
https://consul.acme.com /secret/docker/vars/> grep --values synct
https://consul.acme.com /secret/docker/vars/> grep --regexp ^synct.*
https://consul.acme.com /secret/docker/vars/> grep --regexp ^gui.*
/secret/docker/vars/tnd/syncthing> gui_admin_password = superSecretPassword

Many Thanks

@fishi0x01
Copy link
Owner

Thanks for reaching out! :)

This is expected behavior - from the docs:

grep recursively searches the given SEARCH substring in key and value pairs of given PATH

I.e., (like unix grep) vsh grep does not grep paths for patterns, but rather searches all files for that pattern in a given path. I think what you are looking for would be sth similar to unix find. I will mark this as a new feature request.

@fishi0x01 fishi0x01 added the enhancement New feature or request label Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants