Update stdlibcore.ring : remove result file and last nl of the value in SystemCmd function
@@ -892,7 +892,22 @@ Func chomp(cStr)
Func SystemCmd(cmd)
System(cmd + "> cmd.txt")
- cStr = read("cmd.txt")
+ cResult = read("cmd.txt")
+ # delete result file after get value
+ OSDeleteFile("cmd.txt")
+ cStr = ""
+ pResult = str2list(cResult)
+ len = len(pResult)
+ for line in pResult
+ # if it last item remove newline
+ if pResult[len] = line
+ cStr += substr(line,nl,"")
+ exit
+ ok
+
+ cStr += line + nl
+ next
+
return cStr
/*
