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...

🔀 Juniper Networks EX2300-C-12P 12× Gigabit PoE+ • 2× 10G SFP+ Compact Switch ⚡
$109.99
Juniper EX2300 12-Port Gigabit PoE+ Managed Network Switch P/N: EX2300-C-12P
$149.99
Juniper Networks Mist Wireless Access Points, Model AP45
$59.99
Juniper EX3400-24P 24-Port PoE+ GbE + 4-Port 1/10Gb SFP Switch
$245.00
Juniper Networks MX204-HW-BASE *BRAND NEW FACTORY SEALED* READ DETAILS
$8199.99
Juniper QFX5120-48Y-AFO 48 x 1/10/25GB SFP28 + 8 x 40/100GB Switch w/Dual AC
$10499.99
Juniper MX2K-MPC6E 2 Slot Modular Port Concentrator MPC6E 3D 480G
$272.00
Juniper EX2300-C 12 Port Compact Gigabit Switch EX2300-C-12p Discounted Cosmetic
$79.86
Juniper EX2300-24P 24-port Gigabit RJ-45 PoE 4-port 10Gb SFP+ Network Switch
$89.99
Juniper Networks EX3400-24T 24-Port Ethernet Switch w/Power Cord
$174.99