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
PDFファイルをgrep対象にする #94
Conversation
|
一旦 |
e082d2b
to
76d37d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
テストも書かれているし、よさそうです!ありがとうございます
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
まだアプリケーションの仕様がよくわかってないですが、
- 処理対象のファイルを xargs で取って処理する形なら
set +e
set -e
をしなくてもよくなるかも?list-grep-target.sh | xargs grep.sh > ./tmp/grep_コロナ_$word.txt.tmp
- イメージでしかないので変なこと言ってたら 🙏
$INTERMEDIATE_FILE_PATH
を各関数に引数で渡すといい感じになるかも?- 実装上問題はなさそう
こんな感じで grep の exit code 無視できるかも? #!/usr/bin/env bash -eu
hello() {
echo "hoge" | grep "oga" > /dev/stdout || true
}
world() {
echo "world";
# rm file_does_not_exists.txt
}
main() {
hello
world
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main $@
fi |
closes #5
やったこと
grep.sh
の実装の関数化(やりすぎている節がある)残タスク
pdftotext
がfoo.pdf
をfoo.txt
にするためsanitize_grep_result
とか )