2

I am trying to create a script to be executed in VxWorks. The script should create an output file with specific data. I would like something like the following:

saveFd = open("myoutput.txt",0x102, 0777 )
oldFd = ioGlobalStdGet(1)
ioGlobalStdSet(1, saveFd)

#I would like to use three variables
#I don't know if I should use them as environment variables

putenv("MYBUSA=0x000000") 
putenv("MYBUSD=0x000000") 
putenv("DATAA=0x000000") 

for(i=0;i<N;i++){
    #modify memory using my variables.
    m getenv("MYBUSA"), 4 getenv("DATAA")
    #display memory using my variables. This output should be redirected to the file.
    d getenv("MYBUSB"), 4 
    #update variable DATAA
    DATAA = DATAA + 1;
}

#recover old std output
ioGlobalStdSet(1, oldFd)

Thanks in advance.

4

1 回答 1

1

根据您的文件系统,更改目录。就我而言,我们有真正的闪存文件系统

->cd“/tffs0/cfg”

创建脚本:

-> > 脚本

在此处添加所有其他相关命令

iosDevShow

要关闭文件:

CTRL + D

检查文件是否已创建。

->ls

执行脚本,会在控制台显示:

->< 脚本

要将脚本的所有内容记录到文件中,请使用:

<脚本> script.log

于 2015-05-21T11:49:29.763 回答