From f4d3b78eee6e5256f4331a8d43d8b15677574583 Mon Sep 17 00:00:00 2001 From: stedif <stefano.difrischia@inaf.it> Date: Mon, 11 Oct 2021 13:13:40 +0200 Subject: [PATCH] L2SS-409: fix shellcheck start-DS.sh --- bin/start-DS.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/start-DS.sh b/bin/start-DS.sh index a9c9765d5..06ecb4586 100755 --- a/bin/start-DS.sh +++ b/bin/start-DS.sh @@ -1,3 +1,4 @@ +#!/bin/bash function help() { why="${1}" @@ -29,14 +30,14 @@ esac # ATTENTION # This is assuming that the device server's Python file exists # on the Docker's host in the user's ${HOME} directory. -runThis=$(basename ${deviceServer}) +runThis=$(basename "${deviceServer}") runThis=${runThis//.sh/.py} -if [ -f ${runThis} ]; then +if [ -f "${runThis}" ]; then myDir=${PWD} else - myDir=${PWD}/$(dirname ${deviceServer}) + myDir=${PWD}/$(dirname "${deviceServer}") fi deviceServerPath=${myDir/${HOME}/\/hosthome} # Tango log lines start with a UNIX timestamp. Replace them with the UTC time. -docker exec -it itango python3 ${deviceServerPath}/${runThis} ${instance} ${@} | perl -ne 'use Time::Piece; s/^([0-9]+)/gmtime($1)->strftime("%F %T")/e; print;' +docker exec -it itango python3 "${deviceServerPath}"/"${runThis}" "${instance}" "${@}" | perl -ne 'use Time::Piece; s/^([0-9]+)/gmtime($1)->strftime("%F %T")/e; print;' -- GitLab