5
3

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.

bash / sh | コマンド内容を見るためだけの echo デバッグとさよなら! コマンド自体を標準出力する方法

Last updated at Posted at 2016-06-13

-x オプションを使う。

ファイル

good_bye.sh
echo ABC

実行

$ sh -x good_bye.sh

結果

コマンド自体も標準出力されているのが分かるだろう。

+ echo ABC
ABC

環境

  • sh-3.2
  • bash-3.2
  • Max OS X El Capitan 10.11.4

参考

( ファイル先頭で -x を指定する方法は、自分の環境だとうまく動かなかった )

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

5
3
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
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?