I'm often uncertain, whether a program is a script, or a binary.
And where is it installed?
So I wrote a script, which looks
which command would be used (/usr/bin/foo /usr/local/bin/foo ?)
what kind of file it is (script, elf-binary?)
and if it is a script, it is printed to stdout.
Since I made it (and made some improvements) I'm using it quiete often, so perhaps it's useful for others too:
It's GPL:
Don't miss the final empty lineCode:#/bin/bash # (c) 2003 bashguru Stefan Wagner, Berlin Schöneberg, license: GPL # For a programm: # find where it is (especially if there is more than one): # <which> # what kind of hack is this (elf-binary, bash-script?): # <file> # if it is a script, print it: # <cat> if [[ $# -ne 1 ]]; then echo "Usage: whatmakes.sh THIS" exit fi PROG=$1 LOCATION=$(which $PROG) # not needed, 'file' shows it as well: echo $LOCATION file $LOCATION ART=$(file $LOCATION | grep -c text) if [[ ART -eq 1 ]]; then cat $LOCATION fi
Put it into ~/bin or /usr/local/bin to have it easy accessible in your path.
Feedback is welcome.
manpage and option --help should be made... I know...
IBM 8203 E4A p520 Server 8203-E4A 4.2GHz 2-Core POWER6 32GB RAM / NO HDD USED
$99.99
IBM Power S822 12-Bay Server System Power8 Core 3.42Ghz DVD-Rom Drive 64GB No HD
$399.99
$16000.00
IBM System x3250 M4 Server Intel Xeon E3-1220 3.10GHz 8GB RAM No HDDs
$49.74
IBM Power 720 POWER7 00E6516 3.6GHz CPU 64GB RAM Server
$209.98
IBM Power 740 8205-E6C Express 8-SFF Power7 3.55GHz CPU 64GB RAM *No HDD* Server
$191.99
IBM 7944AC1 System x3550 M3 Server 1*Intel Xeon X5650 2.67GHz 4GB SEE NOTES
$26.97
IBM System x3550 M4 Server 2 x Intel Xeon E5-2609 36GB RAM No HDDs
$68.84
IBM Power S822 8284-22A 2.5" 12-Bay 64GB 2X 00ND478 2X 00E2865 *READ*
$599.99
IBM Lenovo X3650 M5 2U 8x 2.5” CTO Rack Server – 2x HS, 2x 750W
$199.00