2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

前回使用したコマンド結果を利用する

Last updated at Posted at 2016-03-12

前置き

bash・zshは前回利用したコマンドを!!変数に記録しています.

この!!をevalすることで, コマンドの出力を確認しつつ出力を再利用する形でスクリプトを実行することが出来そうです.

$ date +"%m月%d日" # => 03月12日

$ touch `!!`.txt

$ ls # => 03月12日.txt

rubyに限定されてしまいますが, 今回の作業ブランチで作成したspecを再実行するときに利用できます.

$ git diff dev --name-only | grep spec | grep -v factories

$ rspec `!!`
2
2
0

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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?