Browse Source
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
8 years ago
committed by
GitHub
1 changed files with 36 additions and 0 deletions
@ -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…
Reference in new issue