Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Block to comment out - cat xxx:
- <Location /123>
- ich
- bin
- text
- </Location>
- #-----------------------------------------
- Script with error:
- #!/bin/bash
- loc="/123"
- sed -i "/<Location $loc>/,/<\/Location>/s/^/#/" xxx
- sed -i "\:<Location $loc>:,:</Location>:s:^:#:" xxx
- #-----------------------------------------
- Working Script:
- #!/bin/bash
- loc="/123"
- sed "\:<Location $loc>:,\:</Location>:s:^:#:" xxx
- # The second \ after the , was missing.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement