Skip to content

Instantly share code, notes, and snippets.

@iamirulofficial
Created February 24, 2019 09:24
Show Gist options
  • Save iamirulofficial/65100af61f4ae220d3bd235a94be8d28 to your computer and use it in GitHub Desktop.
Save iamirulofficial/65100af61f4ae220d3bd235a94be8d28 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Program: Interactive version -uses read to take two inputs
echo "Enter the pattern to be searched: \n"
read pname
echo "Enter the file to be used: \n"
read filename
echo "Searching for $pname from file $filename"
grep "$pname" $filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment