Skip to content

Instantly share code, notes, and snippets.

@prelegalwonder
Created April 21, 2015 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prelegalwonder/33945f14e8de40c0b74d to your computer and use it in GitHub Desktop.
Save prelegalwonder/33945f14e8de40c0b74d to your computer and use it in GitHub Desktop.
Comment out matched lines in Sed.
#!/bin/bash
for i in `cat policy-redo.txt | grep "Filename:" | awk '{ print $3 }'`
do
sed -i '/^\(.*\)#/!'" s|\(^.*$i.*$\)|#\1|" twpol.txt
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment