RIght, the IOC shell has no mechanism to perform this. You could, however, write a custom command to do this.
On Sep 29, 2019, at 8:25 PM, Michael Davidsaver via Tech-talk < [email protected]> wrote:
On 9/29/19 6:35 PM, Jemian, Pete R. via Tech-talk wrote: Working in the IOC shell (EPICS base 7.0.3), how to remove the last character from an EPICS environment variable?
I don't think there is any way to do this at present.The IOC shell isn't a fully featured shell/programming language.given this definition: epicsEnvSet(PREFIX, "xxx:") I want to achieve this result: "xxx" by somehow editing $(PREFIX) in place.
In bash, this is possible using ${PREFIX::-1} but in the IOC shell:
iocxxx> echo $(PREFIX::-1) macLib: macro PREFIX::-1 is undefined (expanding string echo $(PREFIX::-1))
The context is I want to change this line from:
dbLoadRecords("some.db","IOCNAME=$(PREFIX)")
to:
dbLoadRecords("some.db","IOCNAME=$(PREFIX - 1 character)")
I think you'll have to resort to doing this the other way around.epicsEnvSet("IOCNAME", "blah")epicsEnvSet("PREFIX", "$(IOCNAME):")
|