How to define an array in VxWorks Shell?
arrays, shell, vxworks
Solution
I am not sure you can, directly. You may be able to allocate some memory using eg malloc though, and then set the memory according to the values you want - something like the below should do
//Allocate the array
-> myArray = malloc( 3 )
// use the m Command to edit the memory
-> m &myArray
// do this for each element you want to set
-> 0x12ff3120 1
-> 0x12ff3121 2
// Check the memory
d &myArray
-> 0x12ff3120: 0001 0002 0003 0000
This works assuming you want an array of char sized elements. For other sizes, modifiy the m command to edit in eg word sized blocks:
->m &myArray 4
Problem
How can I define an array in VxWorks shell? For example if I want to have the following: ``` myArray[3] = {1,2,3}; ```