Advertisement
chemoelectric

Untitled

Feb 7th, 2013
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. now=`date +%Y.%m.%d.%H.%M.%S`
  4.  
  5. if [[ -f core ]]; then
  6. echo "Saving an earlier core file --> core.bkp.${now}"
  7. mv core core.bkp.${now}
  8. fi
  9.  
  10. if [[ -f backtrace ]]; then
  11. echo "Saving an earlier backtrace file --> backtrace.bkp.${now}"
  12. mv backtrace backtrace.bkp.${now}
  13. fi
  14.  
  15. ulimit -c unlimited
  16. smed ${1+"$@"}
  17.  
  18. if [[ -f core ]]; then
  19. gdb -batch -c core -ex 'bt full' smed > backtrace
  20. fi
  21.  
  22. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement