Last active
June 30, 2021 06:46
-
-
Save florian25686/db7a46f9e4e6074b182221519440bfdf to your computer and use it in GitHub Desktop.
Find all lines from one file in another file (I'm using csv)
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 3.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Search through the contents of this file | |
search="{full file path}" | |
# Find contents from this file | |
pattern="{full file path}" | |
grep -f <(tr ',' '\n' < "${patterns}") "${search}" | |
# To find contents that is NOT in the search file add -v to the grep command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment