Question: I am trying to create an script that will enable me to Grep a command to find a string of command in a txt file,
I am trying to create an script that will enable me to Grep a command to find a string of command in a txt file, then write a script to count the lines in each file.
on the left side you will see a a list of names that I m trying to grep from and on the right hand side is my script that is providing me with errors.
an detailed explaination on where I went wrong would really help.
open Save test string.txt mbarrett@localhost:-/Desktop Help orange.txt ajay arun sam john james guru File Edit View #1 /bin/bash grep $1 $2 rc=$? Search Terminal then echo "specified string $1 not present in $2" else echo "specified string $1 is present in the file $2" # number of lines of in a file Wc $2| awk 'print $1) find string.sh" 12L, 2190 11,29 All open Save test string.txt mbarrett@localhost:-/Desktop Help orange.txt ajay arun sam john james guru File Edit View #1 /bin/bash grep $1 $2 rc=$? Search Terminal then echo "specified string $1 not present in $2" else echo "specified string $1 is present in the file $2" # number of lines of in a file Wc $2| awk 'print $1) find string.sh" 12L, 2190 11,29 All
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
