EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Is it possible to give parameters to the Startup script (st.cmd)
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Mon, 30 Jun 2008 10:45:01 -0500
On Monday 30 June 2008 09:56:43 haquin wrote:
>
> I wonder if it is possible to give some parameters to the startup script ?
>
> Here is an exemple of what I'd like to do :
>  >myioccore myst.cmd <parameter1> ... <parameterN>

There are a couple of ways to pass parameters into the IOC (on architectures 
other than on vxWorks and RTEMS).  If you don't want to write any code, you 
can use environment variables as Eric suggested, which are made available 
inside your st.cmd script using the ${NAME} or $(NAME) syntax.  Of course 
these won't look like the above example, you'd have to use something like

bash$ export NAME=value
bash$ myioc st.cmd

You could also write a wrapper script that takes arguments and sets them into 
environment variables.

However since you have the source code to myioc in myiocApp/src/myiocMain.c 
you can arrange to parse the command line arguments yourself and convert the 
arguments into environment variables.  You could look for positional 
parameters, setting say the variables $(ARG1), $(ARG2) etc, or you could use 
a named parameter syntax like NAME=VALUE, or best of all do both.

- Andrew
-- 
Talk is cheap. Show me the code. -- Linus Torvalds

References:
Is it possible to give parameters to the Startup script (st.cmd) haquin

Navigate by Date:
Prev: Re: Is it possible to give parameters to the Startup script (st.cmd) Eric Norum
Next: edm on later linux distros John Sinclair
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Is it possible to give parameters to the Startup script (st.cmd) Eric Norum
Next: edm on later linux distros John Sinclair
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·