From 3c0db7b6adbb0b181aac95cd13a5d8664248fc3a Mon Sep 17 00:00:00 2001 From: zimoch Date: Tue, 11 Feb 2014 16:50:54 +0000 Subject: [PATCH] force iocInit before starting seq programs, add -s for shortcut --- iocsh | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/iocsh b/iocsh index 2c3b5e3..9ad32aa 100755 --- a/iocsh +++ b/iocsh @@ -1,7 +1,7 @@ #!/bin/bash SOURCE='$Source: /cvs/G/DRV/misc/iocsh,v $' -REVISION='$Revision: 3.5 $' -DATE='$Date: 2012/08/30 08:05:39 $' +REVISION='$Revision: 3.6 $' +DATE='$Date: 2014/02/11 16:50:54 $' rp() { ( realpath $1 || readlink -f $1 || readlink $1 || echo $1 ) 2>/dev/null @@ -192,8 +192,29 @@ do ;; ( -c ) shift + case $1 in + ( seq* ) + if [ "$init" != NO ] + then + echo "iocInit" + init=NO + fi + ;; + ( iocInit ) + init=NO + ;; + esac echo $1 ;; + ( -s ) + shift + if [ "$init" != NO ] + then + echo "iocInit" + init=NO + fi + echo seq $1 + ;; ( -r ) shift echo "require $1" @@ -214,7 +235,9 @@ do echo " -? or -h or --help: Show this page and exit." echo " -v or --version: Show version and exit." echo " -c: The next string is executed as a command by the EPICS shell." - echo " -r: The next string is a module, loaded via 'require'." + echo " -s: The next string is a sequencer program (and arguments), run with 'seq'." + echo " This forces an 'iocInit' before running the program." + echo " -r: The next string is a module (and version), loaded via 'require'." echo " -n: The next string is the IOC name (used for prompt)." echo " Default: dirname if parent dir is \"ioc\" otherwise hostname." echo