IsraelTorres icon

findversion.sh

IsraelTorres | PRO | 03/22/12 02:00:23 PM UTC | 0 ⭐ | 338 👁️ | Never ⏰ | []
Bash |

520 B

|

None

|

0 👍

/

0 👎

#!/bin/bash
:<<israeltorres_comment_block
 
./findversion.sh
Israel Torres
2012-03-22
nasty way to brute force version info from binary
 
Mac OS X 10.7.3 11D50d 
Darwin Kernel Version 11.3.0
GNU bash, version 3.2.48(1)-release 
 
israeltorres_comment_block
 
#required app check
rqdapp='strings'
hash $rqdapp 2>&- || { echo >&2 "$rqdapp binary not found - aborting"; exit 1; }
#
if [ ! $# -lt 1 ]; then
    SOFTWARE=$1
    strings $(whereis "$SOFTWARE") | grep -C1 -i vers
else
echo "usage: $0 'string'"
echo "example: $0 string"
fi
#eof

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎