Last active 1748861876

permet de récupérer la ligne en erreur et la commande executer

nithir's Avatar nithir revised this gist 1748861876. Go to revision

No changes

nithir's Avatar nithir revised this gist 1748861843. Go to revision

No changes

nithir's Avatar nithir revised this gist 1748859880. Go to revision

1 file changed, 1 insertion

main.sh

@@ -3,5 +3,6 @@ set -euo pipefail
3 3
4 4 # Set a trap to handle errors and log them.
5 5 trap 'echo "Error occurred at line $LINENO. Command: $BASH_COMMAND"' ERR
6 + # https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-LINENO
6 7
7 8 false

nithir's Avatar nithir revised this gist 1748859644. Go to revision

2 files changed, 9 insertions

main.sh(file created)

@@ -0,0 +1,7 @@
1 + #!/usr/bin/env bash
2 + set -euo pipefail
3 +
4 + # Set a trap to handle errors and log them.
5 + trap 'echo "Error occurred at line $LINENO. Command: $BASH_COMMAND"' ERR
6 +
7 + false

output.shell(file created)

@@ -0,0 +1,2 @@
1 + % ./main.sh
2 + Error occurred at line 7. Command: false
Newer Older