1
0

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 1 year has passed since last update.

複数ファイルへのリダイレクト

Posted at

問題:普通のリダイレクトだとファイル1つにしか出力できない。

kubota_akihiro:temp $ ls
kubota_akihiro:temp $ echo aaa > a1 a2
kubota_akihiro:temp $ ls
a1

解決策:teeを使う。teeは出力先を複数にできるから。

kubota_akihiro:temp $ rm a1
kubota_akihiro:temp $ echo aaa | tee a1 a2
aaa
kubota_akihiro:temp $ ls
a1 a2
kubota_akihiro:temp $ cat a1
aaa
kubota_akihiro:temp $ cat a2
aaa
1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?