Skip to content

Instantly share code, notes, and snippets.

@raggleton
Created December 5, 2013 15:22
Show Gist options
  • Save raggleton/7807366 to your computer and use it in GitHub Desktop.
Save raggleton/7807366 to your computer and use it in GitHub Desktop.
This prints out time (in s since 1970) and line number+content to aid in profiling a bash script. Taken from: http://stackoverflow.com/questions/4336035/performance-profiling-tools-for-shell-scripts Note, that sometimes the first digit gets chopped off the date :/
PS4='$(date "+%s.%N ($LINENO) + ")' bash -x scriptname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment