Last active 1748861876

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

main.sh Raw
1#!/usr/bin/env bash
2set -euo pipefail
3
4# Set a trap to handle errors and log them.
5trap '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
7
8false
output.shell Raw
1% ./main.sh
2Error occurred at line 7. Command: false