I have a file containing multiple similar sections
...
# PostgreSQL configuration example
#production:
# adapter: postgresql
# database: redmine
# host: localhost
# username: postgres
# password: "postgres"
# SQLite3 configuration example
#production:
# adapter: sqlite3
# database: db/redmine.sqlite3
# SQL Server configuration example
#production:
# adapter: sqlserver
# database: redmine
# host: localhost
# username: jenkins
# password: jenkins
...
I would like to comment/decomment an entire section.
With "SQLite3" I would like to have the following output:
...
# PostgreSQL configuration example
#production:
# adapter: postgresql
# database: redmine
# host: localhost
# username: postgres
# password: "postgres"
# SQLite3 configuration example
production:
adapter: sqlite3
database: db/redmine.sqlite3
# SQL Server configuration example
#production:
# adapter: sqlserver
# database: redmine
# host: localhost
# username: jenkins
# password: jenkins
...
I tried something like:
sed -i -e '/SQLite3/+1,/^\s*$/ s/^#//' FILE
... but it doesn't work because '+1' is not valid.
How can I start a range on the line after the match? (I tried several variations with braces and 'n', but I didn't find the right spell)