Difference between revisions of "Set (Bash)"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
The <code>-e</code> option will cause a bash script to exit immediately when a command [[error handling|fails]]
+
The <code>-e</code> option will cause a bash script to exit immediately when a command [[error handling|fails]]</code>
[[set -e]] or set -o errexit  
+
*<code>[[set -e]] or set -o errexit </code>
  
set -eo [[pipefail]] https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
+
*<code>set -eo [[pipefail]] https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euxo [[pipefail]]
+
*<code>set -euxo [[pipefail]]</code>
  
  
set -eu
+
*<code>set -eu</code>
[[set -o vi]]
+
*<code>[[set -o vi]]</code>
[[set compatible]]
+
*<code>[[set compatible]]</code>
set -o [[history]] ([[Bash history]])
+
*<code>set -o [[history]] ([[Bash history]])</code>
set -o [[pipefail]]
+
*<code>set -o [[pipefail]]</code>
set -o errtrace  
+
*<code>set -o errtrace</code>
  
set -u error when performing [[parameter expansion]]
+
*<code>set -u error when performing [[parameter expansion]]</code>
  
set -x print every command that is executed and every variable that is set to the standard output. Useful to [[debug]] scripts.
+
*<code>set -x print every command that is executed and every variable that is set to the standard output. Useful to [[debug]] scripts.</code>
  
 
== Related terms ==
 
== Related terms ==

Revision as of 12:07, 13 September 2021

The -e option will cause a bash script to exit immediately when a command fails


  • set -x print every command that is executed and every variable that is set to the standard output. Useful to debug scripts.

Related terms

Activities

See also

Advertising: