The source command is used for executing a set of commands from a file. The interface client shows the command output.
The file may also contain comment lines, which start with #
.
Example 1
The file exampleScript.txt contains the commands: getunitid, getproductinfo, and getunitid.
getunitid
getproductinfo
getunitid
Executing exampleScript.txt.
/> source exampleScript.txt
Unit ID: 1, Client ID: 0, ID: 0x10, Nb: 0, Len: 10, icd_version: D, Err: 0
Serial number: R2730011
Unit ID: 1, Client ID: 0, ID: 0x11, Nb: 1, Len: 113, icd_version: D, Err: 0
Product Name: MD30, Serial Number: R2730011, SW Version: 1.1.0, MT10 ID: 7C0E261A64A4B1C2, HMP Serial Number: P4030022
/> Unit ID: 1, Client ID: 0, ID: 0x10, Nb: 2, Len: 10, icd_version: D, Err: 0
Serial number: R2730011
Example 2
The commented line, product info request, is removed from the response.
getunitid
#getproductinfo
getunitid
Executing the modified exampleScript.txt.
/> source exampleScript.txt
Unit ID: 1, Client ID: 0, ID: 0x10, Nb: 3, Len: 10, icd_version: D, Err: 0
Serial number: R2730011
/> Unit ID: 1, Client ID: 0, ID: 0x10, Nb: 4, Len: 10, icd_version: D, Err: 0
Serial number: R2730011
/>