function readfile(path) local file = io.open(path, "r") if file then local content = file:read("*a") io.close(file) return content end return nil end function writefile(path, content, mode) mode = mode or "w+b" local file = i…
linux命令---查找文件中的内容 [yang@localhost ~]$ cat 1.txt |egrep '123456789|second'-------匹配123456789或者second的行 first line:123456789012345678901234567890123456789012345678901234567890 second line:one two three four five six seven eight nine ten [yang@localh…