How do I remove all lines starting with "-CONFIG_" from a file ?
Hello.
How do I remove all lines starting with "-CONFIG_" from a file ? There are a 100 or so lines to remove for example see below. Thanks Glenn # /bin/cat .config.diff | grep -i "\-CONFIG\_" | tail -CONFIG_VME_BUS=m -CONFIG_VME_CA91CX42=m -CONFIG_VME_TSI148=m -CONFIG_VME_USER=m -CONFIG_VMIVME_7805=m -CONFIG_VT6655=m |
Hi,
Something like this: sed -i.bak '/-CONFIG_/d' infile The -i switch changes in place an creates a back-up with the .bak extension. Hope this helps. |
Code:
ruby -i.bak -ne 'print unless /^-CONFIG/' config.diff |
Code:
grep -v '^-CONFIG_' .config.diff > newfile |
Hi Glenn D,
Same using perl Code:
perl -ni -e 'print unless /^-CONFIG_/' cat.config.diff |
All times are GMT -5. The time now is 08:45 PM. |