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...
Fanxiang 4TB 2TB 1TB SSD 550MB/s 2.5'' SATA III Internal Solid State Drive lot
$219.99
Fanxiang SSD 4TB 2TB 1TB PS5 SSD M.2 NVME SSD 7300MBS PCIe 4.0 Solid State Drive
$269.99
Fanxiang 4TB 2TB 1TB SSD 2.5'' SATA III 560MB/s Internal Solid State Drive lot
$188.09
Fanxiang M.2 SATA SSD 2TB 1TB 512GB 256GB SSD Internal M2 Solid State Drive Lot
$109.99
Patriot P210 128GB 256GB 512GB 1TB 2TB 2.5" SATA 3 6GB/s Internal SSD PC/MAC Lot
$15.50
SAMSUNG 870 EVO 500GB 2.5" SATA SSD HARD DRIVE MZ-77E500 (99% Health)
$39.00
1080PRO 4TB SSD Solid State Hard Drive Ngff M.2 SSD Gaming Internal Hard Disk
$32.99
120 128GB SSD SATA III 2.5" 7mm Solid State Drive MIXED BRAND APPLE LAPTOP zzz-
$9.99
Netac 1TB 2TB 512GB Internal SSD 2.5'' SATA III 6Gb/s Solid State Drive lot
$119.99
Netac 2TB 1TB 512GB 240GB Internal SSD 2.5'' SATAIII 6Gb/s Solid State Drive lot
$118.99