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...
ASUS H110M-R Motherboard Intel 6th/7th Gen LGA1151 DDR4 Micro-ATX i/o shield
$42.00
***NEW*** BCM RX67Q Gaming Motherboard | Intel Q67 2nd/3rd Gen. | LGA1155 | DDR3
$29.77
Micro ATX Desktop Motherboard ASUS H110M-C LGA 1151
$31.95
Asrock Z390 Phantom Gaming 4S/AC Wifi 8th/9th Gen Intel 1151 Motherboard Bulk
$47.55
ASUS Prime Z390-A LGA 1151 Intel Z390 SATA USB 3.1 ATX Motherboard NO I/O
$99.00
MSI B450M PRO-VDH MAX AM4 AMD B450 USB3.2 Micro-ATX Motherboard
$67.99
X99 LGA 2011-v3 MR9D Motherboard 8*DDR4 RAM USB 3.0 SATA3.0 M.2 for E5 V3 V4 CPU
$79.99
MSI A320M-A PRO AM4 AMD A320 USB3.2 Gen1 Micro-ATX Motherboard
$46.99
BTC-S37 Mining Motherboard Kit /w SSD & Ram Preinstalled
$59.99
GIGABYTE MB10-Datto Motherboard Xeon D-1521- SR2DF 2.40 GHz- Open Box
$121.50