Alias remini {
if ($1 == -w) {
var %filename = $2
set -u0 %RemIni.Matches 0
var %start = $read(%filename,s, $+([,$3,]) )
var %start = $readn
[color:blue] ;If %start is 0 that mean we don't find the section what we need[/color]
if (%start == 0) return
[color:blue];Start search from the next line[/color]
var %i = $calc(%start + 1)
var %lines = $lines(%filename)
while (%i <= %lines) {
var %CurLine = $read(%filename,%i)
var %CurKey = $gettok(%CurLine,1,61)
[color:blue];If is null that mean the curent line is somthink like [blabla].. Other section[/color]
if (%CurKey == $null) return
if ($4 iswm %CurKey) {
write -dl $+ %i %filename
inc -u0 %RemIni.Matches
[color:blue];DOn't do inc %i because we just deleted a line.. [/color]
[color:blue];And the next line is now curent line[/color]
goto Continue
}
inc %i
:Continue
;End of while
}
;End of If
}
else {
!remini $1-
}
;End of alias
}