#!/bin/bashsearch_dir="."search_string="@todo"find "$search_dir" -type d -name "node_modules" -prune -o -type f -print | while read -r file; do if grep -iq "$search_string" "$file"; then echo "- [ ] $file" grep -in "$search_string" "$file" | awk -F: '{print " - [ ] todo: " $2}' fidone
上記を実行することで、以下のような出力が得られる。
- [ ] ./next/src/compiled/react-dom/cjs/react-dom.production.js - [ ] todo: // @TODO refactor this block to create the instance here in complete- [ ] ./next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js - [ ] todo: // @TODO add bootstrap script to implicit preloads - [ ] todo: // @TODO refactor text separators so we don't have to defensively add- [ ] ./next/src/compiled/react-dom/cjs/react-dom.profiling.js - [ ] todo: // @TODO refactor this block to create the instance here in complete- [ ] ./next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js - [ ] todo: // @TODO add bootstrap script to implicit preloads - [ ] todo: // @TODO refactor text separators so we don't have to defensively add