in bash, I want to use find to locate only files that ends with .sh. Then for each .sh…
- User
in bash, I want to use find to locate only files that ends with .sh. Then for each .sh file, I want to do a fgrep inside the file to find lines containing the text SRC
Assistant
You can use the
findcommand to locate files that end with.sh, and then usexargsto pass the results tofgrepto search for the textSRC. Here's the command:find /path/to/search -type f -name "*.sh" -print0 | xargs -0 fgrep -i "SRC"This command does the following:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.