Hi all,
I know I can use
==========================================
dbLoadRecords ("db/test.db","device=${DEV},channel=1")
dbLoadRecords ("db/test.db","device=${DEV},channel=2")
dbLoadRecords ("db/test.db","device=${DEV},channel=3")
dbLoadRecords ("db/test.db","device=${DEV},channel=4")
==========================================
in st.cmd script and epics will get the system environment "DEV" so
that I don't need to modify my ioc package and just use
export DEV=blahblah
on each device. But I kind of like my st.cmd script to be clean and neat,
thus I made some .substitutions file like:
======================
file "db/test.db" {
pattern { device, channel }
{ "${DEV}", 1 }
{ "${DEV}", 2 }
{ "${DEV}", 3 }
{ "${DEV}", 4 }
}
======================
For your information, I may have many lines, so the latter is actually
I preferred. But when I put
dbLoadTemplate "db/test.substitutions"
in the st.cmd file instead of the above four messy lines, I got the following
error message:
========================================
dbLoadTemplate "db/test.substitutions"
macLib: macro DEV is undefined (expanding macro device)
========================================
Apparently DEV is not expanded before the records is loaded.
So I'm thinking maybe DEV is not expandable for .substitutions
files. I've searched the talk list but maybe I got the inappropriate
keywords, I didn't get a solution here. So may I ask is there
any way to do that? Or should I just put a bunch of dbLoadRecords
commands with the long ugly macros which can not break into
lines?
--
Best Regards
Chen
----------------------------------------------------------------
Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
| www.sinap.ac.cn
----------------------------------------------------------------
- Replies:
- RE: How to pass system environment to .substitutions? Allison, Stephanie
- Navigate by Date:
- Prev:
Leap second at end of 2008. Thompson, David H.
- Next:
RE: How to pass system environment to .substitutions? Allison, Stephanie
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
<2008>
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Leap second at end of 2008. Thompson, David H.
- Next:
RE: How to pass system environment to .substitutions? Allison, Stephanie
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
<2008>
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|