Changes between Version 1 and Version 2 of Ticket #2712, comment 4
- Timestamp:
- 01/06/12 11:19:06 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #2712, comment 4
v1 v2 6 6 7 7 [root@razorblade /]# tail -8 /etc/mc/cedit.menu 8 {{{ 8 9 #-------------------------- End of common section ----------------------------- 9 10 10 / Comment / Uncomment 11 11 declare -A cl=( ['c']='//' ['h']='//' ['pas']='//' ['sql']='--' ['lua']='--' ) 12 12 c="${cl[%x]:-#}" 13 13 read s < '%b' 14 [[ "${s:0:${#c}}" == "$c" ]] && e="s, !^$c,," || e="s,!^,$c,"14 [[ "${s:0:${#c}}" == "$c" ]] && e="s,^$c,," || e="s,^,$c," 15 15 sed -i "$e" "%b" 16 16 }}} 17 17 2. Run mcedit somefile.txt 18 18 3. Select block with F3, finishing selection with F3 again.