Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to debug fish script?

You can debug a bash script like this:

bash -x script [arg1 ...]`

Question

What is the fish equivalent?

like image 275
Édouard Lopez Avatar asked Dec 09 '15 20:12

Édouard Lopez


People also ask

How do I debug a shell script?

The debugging options available in the Bash shell can be switched on and off in multiple ways. Within scripts, we can either use the set command or add an option to the shebang line. However, another approach is to explicitly specify the debugging options in the command-line while executing the script.

How do I debug a Korn shell script?

The Korn shell provides a number of options that are useful in debugging scripts: noexec (–n), verbose (–v), and xtrace (–x). The noexec (–n) option causes commands to be read without being executed and is used to check for syntax errors. The verbose (–v) option causes the input to displayed as it is read.

Is fish better than zsh?

Fish, or the “Friendly Interactive Shell,” is the most user-friendly and interactive shell, in my opinion. It is much more customizable than Zsh and Bash. It has a ton of cool features like consistent syntax, nice tab completion and syntax highlighting, is easy to pick up and use, and has excellent runtime help.


1 Answers

Fish use a similar flag system:

fish -d 3 script.fish

Where d is the debug flag followed by the verbosity level:

-d or --debug-level=DEBUG_LEVEL specify the verbosity level of fish. A higher number means higher verbosity. The default level is 1.

like image 67
Édouard Lopez Avatar answered Oct 05 '22 11:10

Édouard Lopez