fishshellのxtrace相当

fishshellのxtrace相当

POSIXシェルに該当するものはありますか?set -xまたは、シェルで実行されているコマンドがシェルにset -o xtrace表示されるようにしますか?fish

ベストアンサー1

Fish 3.1.0以降、このfish_trace変数を使用すると、次の機能を使用できます。

> set fish_trace on; isatty; set -e fish_trace
++ source share/fish/functions/isatty.fish
++++ function isatty -d 'Tests if a file descriptor is a tty'
+ isatty
+++ set -l options h/help
+++ argparse -n isatty h/help --
+++ if
+++ set -q _flag_help
+++ end if
+++ if
+++ set -q 'argv[2]'
+++ end if
+++ set -l fd
++++ set fd 0
+++ '[' -t 0 ']'
+ set -e fish_trace

トレース出力の位置は、--debug-outputフィッシュプロセスのオプションによって制御されます。

fish 3.1.0より前は、fish -p some_trace_filefishセッションを実行して構成ファイルを「some_trace_file」に出力することができました。

おすすめ記事