added stripping and life example
This commit is contained in:
+2
-1
@@ -29,7 +29,7 @@ function getvar(varname, c, cmd) {
|
||||
c = (cmd | getline c) > 0 ? int(c) : 0
|
||||
close(cmd); return c
|
||||
}
|
||||
if(varname == "?") { getline c; return evalexpr(c) }
|
||||
if(varname == "?") { getline c; sub(/\r$/, "", c); return evalexpr(c) }
|
||||
if(varname == "'") return int(rand()*65536)
|
||||
return (varname in VARS) ? VARS[varname] : 0
|
||||
}
|
||||
@@ -108,6 +108,7 @@ BEGIN {
|
||||
}
|
||||
|
||||
{
|
||||
sub(/\r$/, "")
|
||||
ln = int($1) % 65536; if(NF > 1) $1 = ""
|
||||
gsub(/^[[:blank:]]+|[[:blank:]]+$/, "")
|
||||
if(ln > 0) {
|
||||
|
||||
Reference in New Issue
Block a user