IsraelTorres

findversion.sh

Mar 22nd, 2012
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. :<<israeltorres_comment_block
  3.  
  4. ./findversion.sh
  5. Israel Torres
  6. 2012-03-22
  7. nasty way to brute force version info from binary
  8.  
  9. Mac OS X 10.7.3 11D50d
  10. Darwin Kernel Version 11.3.0
  11. GNU bash, version 3.2.48(1)-release
  12.  
  13. israeltorres_comment_block
  14.  
  15. #required app check
  16. rqdapp='strings'
  17. hash $rqdapp 2>&- || { echo >&2 "$rqdapp binary not found - aborting"; exit 1; }
  18. #
  19. if [ ! $# -lt 1 ]; then
  20.     SOFTWARE=$1
  21.     strings $(whereis "$SOFTWARE") | grep -C1 -i vers
  22. else
  23. echo "usage: $0 'string'"
  24. echo "example: $0 string"
  25. fi
  26. #eof
RAW Paste Data