I am new to shell scripting and I am trying to figure out the following.
How to search a file for a line containing a particular string and copy that line to a new file if the line is present?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This would create a new file or empty an existing file.
This would create a new file or append found string to an existing file.
Nota:
"string"is a regex. Take a look atman grepfor syntax.