Skip to content

Commit c05992e

Browse files
Merge pull request #276 from KaushikMalapati/shellcheck-daq_waitwin
Shellcheck daq waitwin
2 parents e443800 + f660bee commit c05992e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

scripts/daq_waitwin

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ source /reg/g/pcds/setup/pathmunge.sh
1717
ldpathmunge /usr/local/lib
1818

1919

20-
if [[ $# > 0 ]]; then
21-
SEARCHOPT='--onlyvisible --maxdepth 2 --limit 1 --all --desktop '$1' --sync '
22-
else
23-
SEARCHOPT='--onlyvisible --maxdepth 2 --limit 1 --all --sync '
20+
if [[ $# -gt 0 ]]; then
21+
SEARCHOPT=(--onlyvisible --maxdepth 2 --limit 1 --all --desktop "$1" --sync )
22+
else
23+
SEARCHOPT=(--onlyvisible --maxdepth 2 --limit 1 --all --sync )
2424
fi
25-
proc=`xdotool search $SEARCHOPT --name 'ProcStat'`
26-
ami=`xdotool search $SEARCHOPT --name 'DAQ Online Monitoring'`
27-
env=`xdotool search $SEARCHOPT --name 'Env'`
28-
crwin=`xdotool search $SEARCHOPT --name 'DAQ Control'`
29-
echo $proc $ami $env $crwin
30-
exit
25+
proc=$(xdotool search "${SEARCHOPT[@]}" --name 'ProcStat')
26+
ami=$(xdotool search "${SEARCHOPT[@]}" --name 'DAQ Online Monitoring')
27+
env=$(xdotool search "${SEARCHOPT[@]}" --name 'Env')
28+
crwin=$(xdotool search "${SEARCHOPT[@]}" --name 'DAQ Control')
29+
echo "$proc $ami $env $crwin"
30+
exit

0 commit comments

Comments
 (0)