Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Created June 16, 2015 06:49
Show Gist options
  • Save yuuichi-fujioka/692d580dd32be2f8f633 to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/692d580dd32be2f8f633 to your computer and use it in GitHub Desktop.
bash step debugging. when DEBUG is in environment variable, this script runs with step debugging.
#!/bin/bash
if [ -n "$DEBUG" ]
then
trap 'read -p "$0($LINENO) $BASH_COMMAND"' DEBUG
fi
echo hello
echo world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment