You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
743 B
37 lines
743 B
8 years ago
|
#!/bin/sh
|
||
|
|
||
|
#####################################################################################################
|
||
|
#
|
||
|
# Filename: mygrep.sh
|
||
|
# Author: Hannes Bohnengel
|
||
|
# Last modified: 22 Dec 2016
|
||
|
#
|
||
|
# Comments:
|
||
|
# -------------
|
||
|
# This is a bash script to use grep to search for something
|
||
|
#
|
||
|
#####################################################################################################
|
||
|
|
||
|
# Options
|
||
|
OPT="-rlnw"
|
||
|
|
||
|
# Location where to search
|
||
|
LOC=$1
|
||
|
|
||
|
# Search string
|
||
|
STR=$2
|
||
|
|
||
|
# Define command
|
||
|
MYCMD1="grep $OPT $LOC -e $STR"
|
||
|
|
||
|
# Command to use
|
||
|
CMD=$MYCMD1
|
||
|
|
||
|
# Output:
|
||
|
echo "--------------------------------------------------------------------------------\n
|
||
|
>> Executing the following command:\n
|
||
|
$CMD\n
|
||
|
>> Results of search:\n"
|
||
|
|
||
|
$CMD
|