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  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: newline in IOCSH_PS1 value
From: Mark Rivers <[email protected]>
To: "[email protected]" <[email protected]>, Eric Norum <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Thu, 27 Feb 2014 15:03:27 +0000
Hi Mark,

I don't understand this comment:

> Unfortunately, it doesn't appear to pay any attention to the bash shell environment variables (
> excluding, of course, the standard ones the EPICS code itself requires, such as the EPICS_XXX ones,
>  shown by the epicsParamShow command).

When I do "epicsEnvShow" inside my IOC I see all environment variables from my shell, not just the EPICS_XXX ones:


epics> epicsEnvShow
EDMOBJECTS=/usr/local/epics/extensions/src/edm/setup
REMOTEHOST=denali.cars.aps.anl.gov
MPI_INCLUDE=/usr/include/mpich2-x86_64
MANPATH=/usr/share/man/mpich2:/usr/share/man:/usr/local/share/man
XDG_SESSION_ID=75630
HOSTNAME=corvette.cars.aps.anl.gov
LENPAGE=280
HOST=corvette.cars.aps.anl.gov
TERM=vt100
SHELL=/bin/tcsh
IDL_STARTUP=/usr/local/idl_user/idl_startup.pro
LATEX_MK_DIR=/usr/share/latex-mk
EPICS_SUPPORT_PATH=/home/epics/support
SSH_CLIENT=164.54.160.85 59354 22
IDL_DIR=/usr/local/exelis/idl82
gsas=/home/epics/CEAD/gsas
CVSROOT=/usr/local/cvs
EDMHELPFILES=/usr/local/epics/extensions/src/edm/helpFiles
OLDPWD=/home/epics/support/CARS/iocBoot/ioc13bmc_GPD_XPS
EPICS_IOC_LOG_FILE_LIMIT=10000000
QTDIR=/usr/lib64/qt-3.3
CAQTDM_DISPLAY_PATH=/usr/local/caQtDM/2-6-6/caQtDM/parser:/home/epics/ui
QTINC=/usr/lib64/qt-3.3/include
EDMPVOBJECTS=/usr/local/epics/extensions/src/edm/setup
SSH_TTY=/dev/pts/33
ATMXSECT=/home/epics/CEAD/gsas/data/atmxsect.dat
MPI_PYTHON_SITEARCH=/usr/lib64/python2.7/site-packages/mpich2
GROUP=epics
USER=epics
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/epics/extensions/lib/linux-x86
LS_COLORS=no=00:fi=00:di=01;34:ln=04;31:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=30:sg=30:tw=30:ow=34:st=30:ex=04;30:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;34:*.au=00;34:*.flac=00;34:*.mid=00;34:*.midi=00;34:*.mka=00;34!
 :*.mp3=00;34:*.mpc=00;34:*.ogg=00;34:*.ra=00;34:*.wav=00;34:
MCA_PREFERENCES=/home/epics/mca.preferences
EPICS_BASE=/corvette/usr/local/epics/base-3.14.12.3
HOSTTYPE=x86_64-linux
GSASDIR=/home/epics/CEAD/gsas
MPI_LIB=/usr/lib64/mpich2/lib
EPICS_EXTENSIONS=/usr/local/epics/extensions
GRAPHCAP=X11
SUPPORT=/corvette/home/epics/support
MAIL=/usr/spool/mail/epics
PATH=.:/home/epics/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/local/epics/base/bin/linux-x86:/usr/local/epics/extensions/bin/linux-x86
XRF_PEAK_LIBRARY=/usr/local/idl_user/epics_mca/xrf_peak_library.txt
EPICS_HOST_ARCH=linux-x86
MPI_BIN=/usr/lib64/mpich2/bin
MPI_COMPILER=mpich2-x86_64
EDMFILES=/usr/local/epics/extensions/src/edm/setup
PWD=/home/epics/support/CARS/iocBoot/ioc13bmc_GPD_XPS
_LMFILES_=/etc/modulefiles/mpich2-x86_64
FIT2D=/home/epics/CEAD/fit2d
upcase=/home/epics/CEAD/gsas/upcase
ATOMDATA=/home/epics/CEAD/gsas/data/atmdata.dat
LANG=C
KDE_IS_PRELINKED=1
PYTHONSTARTUP=/home/epics/.python
EPICS_DISPLAY_PATH=/home/epics/adl/all
MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles
LOADEDMODULES=mpich2-x86_64
KDEDIRS=/usr
PGPLOT_XW_WIDTH=0.75
EXELIS_DIR=/usr/local/exelis
JCPDS_PATH=/usr/local/idl_user/epics_mca/jcpds/
[email protected]
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
MPI_SYSCONFIG=/etc/mpich2-x86_64
SHLVL=4
HOME=/home/epics
OSTYPE=Linux
GDL_PATH=+/usr/share/gnudatalanguage/lib:+/usr/local/idl_user
MPI_SUFFIX=_mpich2
PSPRINTER=gse_lom
IDL_PATH=<IDL_DEFAULT>:+/usr/local/idl_user
MPI_MAN=/usr/share/man/mpich2
PGPLOT_DIR=/home/epics/CEAD/gsas/pgl
EPICS_IOC_LOG_FILE_NAME=/home/epics/logs/IOC.log
VENDOR=unknown
PYTHONPATH=/usr/local/python/epics
MACHTYPE=x86_64
LOGNAME=epics
QTLIB=/usr/lib64/qt-3.3/lib
CVS_RSH=ssh
CLASSPATH=/usr/local/epics/extensions/javalib
SSH_CONNECTION=164.54.160.85 59354 164.54.160.82 22
MPI_HOME=/usr/lib64/mpich2
MPI_FORTRAN_MOD_DIR=/usr/include/mpich2-x86_64
MODULESHOME=/usr/share/Modules
LESSOPEN=||/usr/bin/lesspipe.sh %s
XDG_RUNTIME_DIR=/run/user/epics
DISPLAY=localhost:23.0
EPICS_CA_MAX_ARRAY_BYTES=20000000
IDL_ABS_COEFFS=/usr/local/idl_user/synchrotron/sruff/abs_coeffs.xdr
GSASEXE=/home/epics/CEAD/gsas/exe
G_BROKEN_FILENAMES=1
CCACHE_HASHDIR=
_=../../bin/linux-x86/CARSApp
IOCSH_STARTUP_SCRIPT=st.cmd
ARCH=linux-x86
IOC=ioc13bmc_GPD_XPS
TOP=/home/epics/support/CARS
ALLEN_BRADLEY=/corvette/home/epics/support/allenBradley-2-2
AREA_DETECTOR=/corvette/home/epics/support/areaDetector-1-10
ASYN=/corvette/home/epics/support/asyn-4-22
AUTOSAVE=/corvette/home/epics/support/autosave-5-1
BUSY=/corvette/home/epics/support/busy-1-6
CALC=/corvette/home/epics/support/calc-3-2
CAMAC=/corvette/home/epics/support/camac-2-7
CARS=/corvette/home/epics/support/CARS
DAC128V=/corvette/home/epics/support/dac128V-2-7
DELAYGEN=/corvette/home/epics/support/delaygen-1-1-0
DXP=/corvette/home/epics/support/dxp-3-2
IP=/corvette/home/epics/support/ip-2-14
IPAC=/corvette/home/epics/support/ipac-2-11
IP330=/corvette/home/epics/support/ip330-2-7
IPUNIDIG=/corvette/home/epics/support/ipUnidig-2-9
LOVE=/corvette/home/epics/support/love-3-2-5
MCA=/corvette/home/epics/support/mca-7-4
MODBUS=/corvette/home/epics/support/modbus-2-4
MOTOR=/corvette/home/epics/support/motor-6-8
OPTICS=/corvette/home/epics/support/optics-2-9
QUADEM=/corvette/home/epics/support/quadEM-4-0
SNCSEQ=/corvette/home/epics/support/seq-2-1-10
SOFTGLUE=/corvette/home/epics/support/softGlue-2-3
SSCAN=/corvette/home/epics/support/sscan-2-9
STD=/corvette/home/epics/support/std-3-2
STREAM=/corvette/home/epics/support/stream-2-6
TPMAC=/corvette/home/epics/support/tpmac-3-10dls10
VME=/corvette/home/epics/support/vme-2-8-1
VXSTATS=/corvette/home/epics/support/vxStats-1-7-2h
LINES=24
COLUMNS=80


Are you talking about a soft IOC or vxWorks IOC?

Mark


________________________________
From: [email protected] [[email protected]] on behalf of Mark Davis [[email protected]]
Sent: Thursday, February 27, 2014 8:16 AM
To: Eric Norum; [email protected]
Cc: [email protected]
Subject: Re: newline in IOCSH_PS1 value

I had tried the continued line approach (a '\' as the last character).  But all attempts to include a line break withing the string just results in an error:

##--- set IOC shell prompt ---
epicsEnvSet IOCSH_PS1, "\
st.cmd -- Line 200 -- Unbalanced quote.
mdlinux> "
st.cmd -- Line 201 -- Unbalanced quote.

I had not thought of setting a value before launching the IOC shell.  Unfortunately, it doesn't appear to pay any attention to the bash shell environment variables (excluding, of course, the standard ones the EPICS code itself requires, such as the EPICS_XXX ones, shown by the epicsParamShow command).

Now that I am looking for it, I am surprised that I have not been able to find even so much as a hint that commands in the IOC shell can make use of arbitrary environment variables that are set anywhere other than within the IOC shell itself (i.e. other than the special-case/standard ones).  I had assumed that this WAS possible, even if it required some command to do so.  But I have yet to find any command to due this, or any mention at all of some built-in way logic to support it).

Even more interesting is IOCSH_PS1 itself.  Although the epicsEnvSet command is used to set it, epicsEnvShow says it is NOT an environment variable:

epics> epicsEnvShow IOCSH_PS1
IOCSH_PS1 is not an environment variable.

(also not in the list shown if you just type epicsEnvShow)


Perhaps your examples require a newer version of EPICS?  (I am using R3.14.12.2)  But again, numerous Google searches have failed to turn up any document that mentions this one way or the other.


On 2/26/2014 4:54 PM, Eric Norum wrote:
You can set the variable outside the IOC:

>  export IOCSH_PS1="ABC
DEF> "
> ../../bin/darwin-x86/example st.cmd
...
############################################################################
iocRun: All initialization complete
## Start any sequence programs
#seq sncExample, "user=ericHost"
ABC
DEF>


And this seems to work inside the st.cmd file:

epicsEnvSet IOCSH_PS1 "ABC\
DEF> "


../../bin/darwin-x86/example st.cmd
. . .
############################################################################
iocRun: All initialization complete
## Start any sequence programs
#seq sncExample, "user=ericHost"
ABC
DEF>


On Feb 26, 2014, at 1:10 PM, Mark Davis <[email protected]<mailto:[email protected]>> wrote:

Anybody happen to know of a way to include a newline in the IOCSH_PS1 value?


I can include one by manually typing the command in to the IOC shell after it is started:

epics>
epics> epicsEnvSet IOCSH_PS1 "      <---- Ctl+V, Ctl+J typed here....
becoladaq> "

becoladaq>

becoladaq>


But I cannot find any way to do this from the st.cmd startup script.  I have tried using "\n", hex, octal values, etc.  Nothing seems to work.


Mark Davis
NSCL/FRIB


--
Eric Norum
[email protected]<mailto:[email protected]>







Replies:
Re: newline in IOCSH_PS1 value Mark Davis
References:
newline in IOCSH_PS1 value Mark Davis
Re: newline in IOCSH_PS1 value Eric Norum
Re: newline in IOCSH_PS1 value Mark Davis

Navigate by Date:
Prev: Re: newline in IOCSH_PS1 value Eric Norum
Next: Re: Monitoring whether an IP device is connected or not Pearson, Matthew R.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: newline in IOCSH_PS1 value Mark Davis
Next: Re: newline in IOCSH_PS1 value Mark Davis
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·