【发布时间】:2017-09-28 04:03:15
【问题描述】:
我在 VBS 中有这段代码,需要在 Bash 中重建。这是我必须转换的更大脚本的 sn-p。有人可以帮我解决这个问题吗?
在过去的两天里,我阅读了很多关于 Bash 的文档,我一直在编写更大的脚本,但仍然不确定如何去做。我的同事/培训师基本上把这个递给了我,并告诉我使用谷歌来学习 Bash 来做到这一点。我觉得同样重要的是要注意我对 VBScript 也不熟悉。
Function Build_Param_Array()
Set objFSO = WScript.CreateObject("Scripting.Filesystemobject")
Set ReadFile = objFSO.OpenTextFile("Param_List.txt")
While Not ReadFile.AtEndOfStream
thisline = ReadFile.ReadLine
Pcount = Pcount + 1
ReDim preserve arrParam(Pcount)
If Not Right(thisline,1) = "|" Then thisline = thisline & "|"
arrParam(Pcount) = thisline
Wend
End Function
【问题讨论】: