Hi, I am faced with the following issue. I have a resolve.conf file made of sections like
#Company IT nameservers nameserver 1.2.3.4 nameserver 1.2.3.5 nameserver 1.2.3.6 #Lab1 nameservers #nameserver 10.1.2.3 #nameserver 10.1.2.4 #Lab2 nameservers #nameserver 20.1.2.2 I want to use vim -c to do to tasks. a- comment out a given section (say section that starts with comment #Company IT ) b- uncomment a given section (say section that starts with comment #Lab1) In an interactive VIM session that would have been trivial (/ <pattern> then vap then s/^/#/ or s/^#// for example). However I want to embed this in a bash script so it must be non interactive. I can always use perl/python for this but I feel like its bringing a cannon to kill the fly which I usually try to avoid. I also have a bonus question to the unix gurus here - how can I perform said tasks with sed or awk?- I'm using these tools frequently but for much simpler, regexp oriented, tasks. This one requires more semantic understanding of the input which is not trivial to achieve with sed/awk. VIM however understand the notion of a paragraph (as well as sentence and work) which make it perfect for the task. TIA, Yosi --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
