Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 AllStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started