Browse Source

This is the very first initial draft of the script

The purpose of this script is to search after specific patterns inside files in a directory. The proper functionality is not tested yet.
master
hannes 7 years ago
committed by GitHub
parent
commit
86e0deae08
  1. 36
      mygrep.sh

36
mygrep.sh

@ -0,0 +1,36 @@
#!/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
Loading…
Cancel
Save