Created
June 8, 2021 12:57
-
-
Save HotFusionMan/f71dcfde1afe64c38909be7aa27fecad to your computer and use it in GitHub Desktop.
version of `about` from https://www.networkworld.com/article/3620895/what-asking-which-whereis-or-whatis-can-tell-you-about-linux-commands.html for macOS X (developed on 10.14.6)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# From https://www.networkworld.com/article/3620895/what-asking-which-whereis-or-whatis-can-tell-you-about-linux-commands.html , with syntax corrections for macOS X. | |
clear | |
if [ $# == 0 ]; then # if no arguments provided, prompt user | |
echo -n "What command(s) are you asking about?> " | |
read args | |
else | |
args=$* | |
fi | |
for cmd in `echo $args` # for each command entered | |
do | |
echo "$cmd" | |
echo -n "executable: " | |
which $cmd | |
echo -n "all files: " | |
whereis $cmd | sed "s/$cmd: //" | |
echo 'function(s):' | |
echo "`whatis $cmd`" | |
echo "====================================================================" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment