"set -xe" in fish shell

4

1

In bash, invoking set -x at the beginning of a script causes the commands to be printed on stdout while the script is executing. What's the equivalent syntax for the fish shell?

Sridhar Ratnakumar

Posted 2012-11-01T13:48:59.860

Reputation: 4 041

2I think it's one of those deal-braking features between bash and fish. – Ярослав Рахматуллин – 2013-03-10T23:20:06.510

Answers

0

Fish's set command doesn't have that option.

However you could wrap set in your shell script. This would print the same format of output you're used to when placed at the top of a script.

function set; echo + set $argv; builtin set $argv; end

Alternatively, the function command has an --on-variable option that allows you to monitor particular variables for changes and have the function called automatically.

Or you can execute your fish script with fish -d 3 script.fish. This will print some tracing information.

Aaron Gyes

Posted 2012-11-01T13:48:59.860

Reputation: 31