LoginSignup
1

More than 5 years have passed since last update.

コマンドの結果が空でもエビデンスを取る方法

Posted at

コマンドの結果が空でもエビデンスを取る方法

概要

  • タスクをチケットのWikiに落としたり、実行手順を書く際
  • 空であることをエビデンスとして残すのがずっと気にかかっていた
  • 下記の様な期待値を捏造することが必要だった
$ grep -r foo ./bar
# 結果がないこと

問題点

  • #を使うことでコメントの様にも見えるが、root権限でコマンドを実行している様にも見えてしまう
  • また、# 結果がないこと という文言がcliでの実行結果を反映していない

解決策

  • 実行結果をwcコマンドに食わせる
$ grep foo ./bar | wc -l
       0

備考

  • Before/After は確認しましょう

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1