Skip to content

Instantly share code, notes, and snippets.

@ebeigarts
Created December 19, 2012 22:20
Show Gist options
  • Save ebeigarts/4341068 to your computer and use it in GitHub Desktop.
Save ebeigarts/4341068 to your computer and use it in GitHub Desktop.
Bash debugging
PS4='+ $(date "+%s.%N") $BASH_SOURCE:$LINENO#$FUNCNAME \011 '
set -x

Example Output:

++ 1355955482.N ./.bashrc:11    source ./.rvm/scripts/rvm
+++ 1355955482.N ./.rvm/scripts/rvm:21 	 __rvm_has_opt posix
+++ 1355955482.N ./.rvm/scripts/rvm:2 	 [[ -n '' ]]
+++ 1355955482.N ./.rvm/scripts/rvm:5 	 [[ -n 3.2.48(1)-release ]]
+++ 1355955482.N ./.rvm/scripts/rvm:5 	 [[ :braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor:xtrace: =~ :posix: ]]
+++ 1355955482.N ./.rvm/scripts/rvm:7 	 return 1
+++ 1355955482.N ./.rvm/scripts/rvm:26 	 export HOME rvm_prefix rvm_user_install_flag rvm_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment