From 5c028c7ff86a792f7bacc9d3809a70d83ca07595 Mon Sep 17 00:00:00 2001 From: JaydenMW Date: Mon, 8 Mar 2021 18:23:38 +0000 Subject: [PATCH] Upload files to '' --- command-search.sh | 12 ++++++++++++ man-search.sh | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 command-search.sh create mode 100644 man-search.sh diff --git a/command-search.sh b/command-search.sh new file mode 100644 index 0000000..f3ccd82 --- /dev/null +++ b/command-search.sh @@ -0,0 +1,12 @@ +# Arguments +SEARCH=$1 + +# Throw an error if no arguments are provided +if [ "$*" == "" ]; then + echo "You must provide arguments. ./command-search.sh " + exit 1 +fi + +# Take these arguments and search the manpage for the search query +ls /usr/bin | grep -x $SEARCH --color=auto || echo "This command is not available/installed" + diff --git a/man-search.sh b/man-search.sh new file mode 100644 index 0000000..5c7d718 --- /dev/null +++ b/man-search.sh @@ -0,0 +1,13 @@ +# Arguments +PAGE=$1 +SEARCH=$2 + +# Throw an error if no arguments are provided +if [ "$*" == "" ]; then + echo "You must provide arguments. ./man-search.sh " + exit 1 +fi + +# Take these arguments and search the manpage for the search query +man $PAGE | grep $SEARCH --color=auto || echo "Your search query wasn't found in this manpage" +