epics-modules / xxx

APS BCDA synApps module: xxx
http://epics-modules.github.io/xxx
Other
5 stars 6 forks source link

BUG: bash syntax incorrect in starter script #24

Closed prjemian closed 4 years ago

prjemian commented 5 years ago

in IOC built from xxx 6.1:


(base) mintadmin@mint-vm:.../iocvm7/softioc$ ./vm7.sh stop
./vm7.sh: 110: ./vm7.sh: [[: not found
./vm7.sh: 115: ./vm7.sh: [[: not found
./vm7.sh: 110: ./vm7.sh: [[: not found
./vm7.sh: 115: ./vm7.sh: [[: not found```
prjemian commented 5 years ago

See this source: https://github.com/epics-modules/xxx/blob/e798cbdecc3d394436dd2f9b504d27f59f6b6d32/iocBoot/iocxxx/softioc/xxx.sh#L110-L118

Fix is to use single [, not double [[:

                            if [ ${s_pid} -eq ${P_PID} ] ; then
                                SCREEN_PID=${s_pid}
                                break
                            fi

                            if [ ${s_pid} -eq ${GP_PID} ] ; then
                                SCREEN_PID=${s_pid}
                                break
                            fi
kmpeters commented 5 years ago

Do the variables need to be in quotes when single square braces are used?

prjemian commented 5 years ago

Not required but great advice

On Tue, Sep 3, 2019, 10:46 AM Kevin Peterson notifications@github.com wrote:

Do the variables need to be in quotes when single square braces are used?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/epics-modules/xxx/issues/24?email_source=notifications&email_token=AARMUMGI3V233VQR3MX47ELQH2BGVA5CNFSM4IS6YCUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5YUTXA#issuecomment-527518172, or mute the thread https://github.com/notifications/unsubscribe-auth/AARMUMCRZHS4MU2BKIWLUWLQH2BGVANCNFSM4IS6YCUA .