Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

@rentalname@github

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

前置き

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 `!!`
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
2
Help us understand the problem. What are the problem?