Sysadmin Blog
Linux notes
Tuesday, June 17, 2014
Bash - cross-reference two files
I have two files: list_to_remove and current_list. I want to remove all servers from list_to_remove from the current list.
for i in $(cat list_to_remove); do grep -v "$i.company.com" current_list > temp && mv temp current_list; done
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment