Last active
February 11, 2024 16:42
-
-
Save disouzam/000eca688b1dcdd5046c42da95c0be10 to your computer and use it in GitHub Desktop.
Header of bash script to log commands and line number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o xtrace | |
PS4='${LINENO}: ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Template based on https://stackoverflow.com/questions/17804007/how-to-show-line-number-when-executing-bash-script/17805088#17805088 / https://stackoverflow.com/a/67830485