Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2722

シェルで変数とその内容を全部出力する方法

$
0
0

デバッグ時、エラー出力時に便利です。

引数なしのsetコマンドで全て出力されます。
set

Bashの場合は以下です。
(set -o posix; set)
POSIXと異なり、setだけだと変数に加え関数まで出力されてしまいます。
そこでPOSIXモードで出力すれば変数だけになる仕組みです。


Viewing all articles
Browse latest Browse all 2722

Trending Articles