diff --git a/bin/profile_axis b/bin/profile_axis index 35a7fa2acf4..9ec5850243a 100755 --- a/bin/profile_axis +++ b/bin/profile_axis @@ -1,4 +1,4 @@ #!/bin/bash -SCRIPT_LOCATION=$(dirname $(readlink -f $0)) -python3 -mcProfile -o axis.profile $SCRIPT_LOCATION/axis "$@" +SCRIPT_LOCATION=$(dirname "$(readlink -f "$0")") +python3 -mcProfile -o axis.profile "$SCRIPT_LOCATION"/axis "$@" (echo sort cumulative; echo stats 20) | python3 -mpstats axis.profile diff --git a/debian/configure b/debian/configure index 8315085c923..bf13b05a15f 100755 --- a/debian/configure +++ b/debian/configure @@ -28,7 +28,7 @@ EOF cd "${0%/*}" -if [ "$1" == "-h" -o "$1" == "-help" -o "$1" == "--help" ]; then +if [ "$1" == "-h" ] || [ "$1" == "-help" ] || [ "$1" == "--help" ]; then usage exit 0 fi @@ -168,7 +168,7 @@ sed \ -e "s|@YAPPS_RUNTIME@|$YAPPS_RUNTIME|g" \ -e "s#@ENABLE_BUILD_DOCUMENTATION@#$ENABLE_BUILD_DOCUMENTATION#g" \ -e '/^\s*,\s*$/d' \ - $* + "$@" } if [[ -z "${COMPAT}" ]]; then diff --git a/debian/tests/linuxcnc-test b/debian/tests/linuxcnc-test index 903b670d5c2..807c0a9c173 100755 --- a/debian/tests/linuxcnc-test +++ b/debian/tests/linuxcnc-test @@ -4,7 +4,7 @@ set -e -cd $(dirname $0) +cd "$(dirname "$0")" if ! linuxcnc -r linuxcnc-test.ini ; then echo "error: failed to execute linuxcnc" diff --git a/debian/tests/rs274-test b/debian/tests/rs274-test index c555b93c81d..9f97d962d12 100755 --- a/debian/tests/rs274-test +++ b/debian/tests/rs274-test @@ -2,17 +2,17 @@ set -e -cd $(dirname $0) +cd "$(dirname "$0")" log=$AUTOPKGTEST_TMP/rs274.out -if ! rs274 -g rs274.ngc > $log 2>&1 ; then +if ! rs274 -g rs274.ngc > "$log" 2>&1 ; then echo "error: failed to run rs274" - cat $log + cat "$log" exit 1 fi -if ! diff -u $log rs274.res ; then +if ! diff -u "$log" rs274.res ; then echo "error: rs274 output do not match rs274.res" exit 1 fi diff --git a/nc_files/M101 b/nc_files/M101 index eed466e6429..9d2eb115f18 100755 --- a/nc_files/M101 +++ b/nc_files/M101 @@ -8,8 +8,8 @@ P=$1 Q=$2 -MCMD=$(readlink -nf $0) ;# canonical file name -MNAME=$(basename $MCMD) +MCMD=$(readlink -nf "$0") +MNAME=$(basename "$MCMD") echo echo "Example for User M-code invocation:" @@ -19,4 +19,4 @@ echo "$MNAME P$P Q$Q" # if a M1nn command exits with nonzero status, # the G-code program exits. So always exit 0. -exit 0 ;# 0 for success +exit 0 diff --git a/scripts/get-deb-component-from-git b/scripts/get-deb-component-from-git index 7c0cf3f9b1f..8b28f72406d 100755 --- a/scripts/get-deb-component-from-git +++ b/scripts/get-deb-component-from-git @@ -1,12 +1,12 @@ #!/bin/bash -if [ ! -z "$EMC2_HOME" ]; then - source $EMC2_HOME/scripts/githelper.sh +if [ -n "$EMC2_HOME" ]; then + source "$EMC2_HOME"/scripts/githelper.sh else - source $(git rev-parse --show-toplevel)/scripts/githelper.sh + source "$(git rev-parse --show-toplevel)"/scripts/githelper.sh fi -githelper $1 +githelper "$1" -echo $DEB_COMPONENT +echo "$DEB_COMPONENT" diff --git a/scripts/get-version-from-git b/scripts/get-version-from-git index 544181b3fa2..3c77834f959 100755 --- a/scripts/get-version-from-git +++ b/scripts/get-version-from-git @@ -1,18 +1,18 @@ #!/bin/bash -if [ ! -z "$EMC2_HOME" ]; then - source $EMC2_HOME/scripts/githelper.sh +if [ -n "$EMC2_HOME" ]; then + source "$EMC2_HOME"/scripts/githelper.sh else - source $(git rev-parse --show-toplevel)/scripts/githelper.sh + source "$(git rev-parse --show-toplevel)"/scripts/githelper.sh fi -githelper $1 +githelper "$1" if [ "$DEB_COMPONENT" = "scratch" ]; then # unknown branches get the VERSION file, plus the branch name (with any # characters that are invalid in debian version numbers replaced with # dashes '-'), plus the HEAD commit SHA1 - echo v$(git show HEAD:VERSION | cut -d ' ' -f 1)~${GIT_BRANCH//[^-.+:~a-z0-9]/-}~$(git show --pretty=format:%h HEAD | head -1) + echo "v$(git show HEAD:VERSION | cut -d ' ' -f 1)~${GIT_BRANCH//[^-.+:~a-z0-9]/-}~$(git show --pretty=format:%h HEAD | head -1)" else # known branches get the "describe" of the most recent signed git tag, # or of the most recent unsigned tag if no signed tags are found diff --git a/scripts/githelper.sh b/scripts/githelper.sh index 283192d2f13..90be8fb7139 100644 --- a/scripts/githelper.sh +++ b/scripts/githelper.sh @@ -12,6 +12,7 @@ # Sets GIT_TAG to the most recent signed tag (this will fall back to the # most recent tag of any kind if no signed tag is found). # +# shellcheck shell=bash function githelper() { @@ -45,32 +46,35 @@ function githelper() { ;; *) GIT_TAG_GLOB="*" + # Disable unused variable warnings on DEB_COMPONENT + # shellcheck disable=SC2034 DEB_COMPONENT="scratch" ;; esac # use the gnupg keyring from our git repo to verify signatures on the release tags - export GNUPGHOME=$(git rev-parse --show-toplevel)/gnupg + GNUPGHOME=$(git rev-parse --show-toplevel)/gnupg + export GNUPGHOME NEWEST_SIGNED_TAG_UTIME=-1 NEWEST_UNSIGNED_TAG_UTIME=-1 for TAG in $(git tag -l "$GIT_TAG_GLOB"); do - if ! git cat-file tag $TAG > /dev/null 2> /dev/null; then + if ! git cat-file tag "$TAG" > /dev/null 2> /dev/null; then continue fi - TAG_UTIME=$(git cat-file tag $TAG | grep tagger | awk '{print $(NF-1)-$NF*36}') + TAG_UTIME=$(git cat-file tag "$TAG" | grep tagger | awk '{print $(NF-1)-$NF*36}') if git tag -v "$TAG" > /dev/null 2> /dev/null; then # it's a valid signed tag - if [ $TAG_UTIME -gt $NEWEST_SIGNED_TAG_UTIME ]; then + if [ "$TAG_UTIME" -gt "$NEWEST_SIGNED_TAG_UTIME" ]; then NEWEST_SIGNED_TAG=$TAG NEWEST_SIGNED_TAG_UTIME=$TAG_UTIME fi else # unsigned tag - if [ $TAG_UTIME -gt $NEWEST_UNSIGNED_TAG_UTIME ]; then + if [ "$TAG_UTIME" -gt "$NEWEST_UNSIGNED_TAG_UTIME" ]; then NEWEST_UNSIGNED_TAG=$TAG NEWEST_UNSIGNED_TAG_UTIME=$TAG_UTIME fi @@ -78,13 +82,17 @@ function githelper() { done - if [ $NEWEST_SIGNED_TAG_UTIME -gt -1 ]; then + if [ "$NEWEST_SIGNED_TAG_UTIME" -gt -1 ]; then + # Disable unused variable warnings on GIT_TAG + # shellcheck disable=SC2034 GIT_TAG="$NEWEST_SIGNED_TAG" return fi - if [ $NEWEST_UNSIGNED_TAG_UTIME -gt -1 ]; then + if [ "$NEWEST_UNSIGNED_TAG_UTIME" -gt -1 ]; then echo "no signed tags found, falling back to unsigned tags" > /dev/null 1>&2 + # Disable unused variable warnings on GIT_TAG + # shellcheck disable=SC2034 GIT_TAG="$NEWEST_UNSIGNED_TAG" return fi diff --git a/scripts/gladevcp_demo b/scripts/gladevcp_demo index 98f3ebc96cb..193c248f42c 100755 --- a/scripts/gladevcp_demo +++ b/scripts/gladevcp_demo @@ -23,7 +23,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -prog=$(basename $0) +prog=$(basename "$0") function usage () { cat </dev/null status=$? -if [ $status = 0 ] ; then +if [ "$status" = 0 ] ; then msg="$prog: Realtime is already active" echo "$msg" popup "$msg" @@ -71,10 +71,10 @@ case $# in *) ARGS="$@";; esac -if [ ! -z "$debug" ] ; then - echo debug=$debug - echo REALTIME=$REALTIME - echo ARGS="$ARGS" +if [ -n "$debug" ] ; then + echo "debug=$debug" + echo "REALTIME=$REALTIME" + echo "ARGS=$ARGS" pwd fi diff --git a/scripts/halrun.in b/scripts/halrun.in index 63f4b8bde83..d3ee6383998 100644 --- a/scripts/halrun.in +++ b/scripts/halrun.in @@ -2,7 +2,7 @@ PATH=@EMC2_BIN_DIR@:$PATH REALTIME=@REALTIME@ -THIS=$(basename $0) +THIS=$(basename "$0") export HAL_RTMOD_DIR=@EMC2_RTLIB_DIR@ @@ -60,7 +60,7 @@ while getopts "ef:hi:kqsvIRQTUV" opt ; do exit 1;; esac done -shift $(($OPTIND - 1)) +shift $((OPTIND - 1)) if [ $# -gt 1 ] ; then echo "$THIS: too many arguments <$*>" @@ -150,17 +150,17 @@ if $HAVEFILE ; then halcmd_twopass "$filename"; result=$? fi elif $IS_HALTCL; then - haltcl $@; result=$? + haltcl "$@"; result=$? else - halcmd $@; result=$? + halcmd "$@"; result=$? fi fi -if [ ! -z "$INTERACTIVE" ]; then $INTERACTIVE; fi +if [ -n "$INTERACTIVE" ]; then $INTERACTIVE; fi halcmd stop || result=$? halcmd unload all || result=$? $REALTIME stop || result=$? -exit $result +exit "$result" diff --git a/scripts/linuxcnc_info.in b/scripts/linuxcnc_info.in index 668634114af..ac32e1ed319 100755 --- a/scripts/linuxcnc_info.in +++ b/scripts/linuxcnc_info.in @@ -21,7 +21,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ofile=/tmp/linuxcnc_info.txt -PROG=$(basename $0) +PROG=$(basename "$0") usage () { cat </dev/null) + echo "$(cd "$dir" && git rev-parse --short HEAD 2>/dev/null)" fi } @@ -49,7 +49,7 @@ git_commit () { editors="$VISUAL gedit mousepad geany nedit nano gvim abiword" VIEWER="" for e in $editors ; do - if [ -x "$(command -v $e)" ] ; then + if [ -x "$(command -v "$e")" ] ; then VIEWER=$e break #use first editor found fi @@ -81,7 +81,7 @@ function show () { } function parse_cpuinfo () { - cat /proc/cpuinfo|grep "$1"|head -1|cut -d: -f2- + grep "$1" < /proc/cpuinfo | head -1 | cut -d: -f2- } function parse_after_colon () { @@ -111,58 +111,58 @@ system and configuration. EOF -[ -n "$VIEWER" ] && echo VIEWER=$VIEWER - -show " Date" $(date) -show " UTC Date" $(date -u) -show " this program" $0 -show " uptime" $(uptime) -show " lsb_release -sa" $(lsb_release -sa 2>/dev/null) -show " linuxcnc" $(command -v linuxcnc) -show " pwd" $(pwd -P) -show " USER" $USER -show " LOGNAME" $LOGNAME -show " HOME" $HOME -show " EDITOR" $EDITOR -show " VISUAL" $VISUAL -show " LANGUAGE" $LANGUAGE -show " TERM" $TERM -show " COLORTERM" $COLORTERM -show " DISPLAY" $DISPLAY -show " DESKTOP" $DESKTOP_SESSION -show " display size" $(parse_after_colon $(xdpyinfo|grep dimensions)) -show " PATH" $PATH +[ -n "$VIEWER" ] && echo "VIEWER=$VIEWER" + +show " Date" "$(date)" +show " UTC Date" "$(date -u)" +show " this program" "$0" +show " uptime" "$(uptime)" +show " lsb_release -sa" "$(lsb_release -sa 2>/dev/null)" +show " linuxcnc" "$(command -v linuxcnc)" +show " pwd" "$(pwd -P)" +show " USER" "$USER" +show " LOGNAME" "$LOGNAME" +show " HOME" "$HOME" +show " EDITOR" "$EDITOR" +show " VISUAL" "$VISUAL" +show " LANGUAGE" "$LANGUAGE" +show " TERM" "$TERM" +show " COLORTERM" "$COLORTERM" +show " DISPLAY" "$DISPLAY" +show " DESKTOP" "$DESKTOP_SESSION" +show " display size" "$(parse_after_colon "$(xdpyinfo|grep dimensions)")" +show " PATH" "$PATH" echo echo "uname items:" -show " nodename -n" $(uname -n) -show " kernel-name -s" $(uname -s) -show " kernel-vers -v" $(uname -v) -show " machine -m" $(uname -m) -show " processor -p" $(uname -p) -show " platform -i" $(uname -i) -show " oper system -o" $(uname -o) +show " nodename -n" "$(uname -n)" +show " kernel-name -s" "$(uname -s)" +show " kernel-vers -v" "$(uname -v)" +show " machine -m" "$(uname -m)" +show " processor -p" "$(uname -p)" +show " platform -i" "$(uname -i)" +show " oper system -o" "$(uname -o)" show "" echo "/proc items:" -show " cmdline" $(< /proc/cmdline) -show " model name" $(parse_cpuinfo "model name") -show " cores" $(parse_cpuinfo "cpu cores") -show " cpu MHz" $(parse_cpuinfo "cpu MHz") -show " parport" $(cat /proc/ioports|grep parport) -show " serial" $(cat /proc/ioports|grep serial) +show " cmdline" "$(< /proc/cmdline)" +show " model name" "$(parse_cpuinfo "model name")" +show " cores" "$(parse_cpuinfo "cpu cores")" +show " cpu MHz" "$(parse_cpuinfo "cpu MHz")" +show " parport" "$(grep parport < /proc/ioports)" +show " serial" "$(grep serial < /proc/ioports)" echo echo "Versions:" -show " gcc" $(gcc --version|head -1) -show " python" $(@PYTHON@ --version 2>&1) -show " git" $(tryversion git) -show " git commit" $(git_commit) -show " tcl" $(echo "puts $::tcl_version"|tclsh) -show " tk" $(echo "puts $::tk_version;destroy ."|wish) -show " glade" $(tryversion glade) +show " gcc" "$(gcc --version|head -1)" +show " python" "$(@PYTHON@ --version 2>&1)" +show " git" "$(tryversion git)" +show " git commit" "$(git_commit)" +show " tcl" "$(echo "puts $::tcl_version"|tclsh)" +show " tk" "$(echo "puts $::tk_version;destroy ."|wish)" +show " glade" "$(tryversion glade)" echo echo "linuxcnc_var all:" echo for n in $(linuxcnc_var all) ; do - show "${n%%=*}" ${n##*=} + show "${n%%=*}" "${n##*=}" done echo diff --git a/scripts/linuxcnc_var.in b/scripts/linuxcnc_var.in index 3217a459d4e..9d4c835042e 100644 --- a/scripts/linuxcnc_var.in +++ b/scripts/linuxcnc_var.in @@ -25,7 +25,7 @@ function usage () { Retrieve Linuxcnc Variables Usage: - $(basename $0) [ varname | all ] + $(basename "$0") [ varname | all ] Varnames supported: LINUXCNCVERSION @@ -67,7 +67,7 @@ function show_item () { case $# in 0) usage;; - 1) show_item $1;; + 1) show_item "$1";; *) usage;; esac exit 0 diff --git a/scripts/man2adoc-migrate b/scripts/man2adoc-migrate index 530a66a470c..fbc60759674 100755 --- a/scripts/man2adoc-migrate +++ b/scripts/man2adoc-migrate @@ -4,33 +4,33 @@ # Convert all non-link manual pages to adoc for m in docs/man/man?/*; do - test -L $m && continue - n=$(echo $m |sed s%docs/man%docs/src/man%).adoc - if [ -e "$n" ] || [ -e "$n".in ] || grep -q '^.so' $m; then - echo "Not converting $m due to roff include or existing adoc version" + test -L "$m" && continue + n=$(echo "$m" |sed s%docs/man%docs/src/man%).adoc + if [ -e "$n" ] || [ -e "$n".in ] || grep -q '^.so' "$m"; then + echo "E: Not converting $m due to roff include or existing adoc version" else - echo "Converting $m to $n" - pandoc -f man -t asciidoc $m -o $n - git add $n - git rm --quiet $m + echo "I: Converting '$m' to '$n'" + pandoc -f man -t asciidoc "$m" -o "$n" + git add "$n" + git rm --quiet "$m" fi done # Make sure they can be converted back to manpage format for n in docs/src/man/man?/*.adoc; do #echo "Making sure $n got required header" - b=$(basename $n .adoc) - name=$(echo $b|cut -d. -f1) - s=$(echo $b|cut -d. -f2) - if ! head -1 $n | grep -q "= $name ($s)" || + b=$(basename "$n" .adoc) + name=$(echo "$b"|cut -d. -f1) + s=$(echo "$b"|cut -d. -f2) + if ! head -1 "$n" | grep -q "= $name ($s)" || ! "/usr/bin/asciidoc" --backend docbook \ -a "a2x-format=manpage" --doctype manpage \ --attribute "mansource=LinuxCNC" \ --attribute "manmanual=LinuxCNC Documentation" \ --verbose \ - --out-file x.man $m + --out-file x.man "$m" then - (echo "= $name($s)"; echo; cat $n) > $n.new && mv $n.new $n - git add $n + (echo "= $name($s)"; echo; cat "$n") > "$n.new" && mv "$n.new" "$n" + git add "$n" fi done diff --git a/scripts/rip-environment.in b/scripts/rip-environment.in index 588c73b9a8f..692aa11ace0 100644 --- a/scripts/rip-environment.in +++ b/scripts/rip-environment.in @@ -49,7 +49,9 @@ case "$0" in *) as_command=false esac -if ! test "xyes" = "x@RUN_IN_PLACE@"; then +# This evaluates to [ "yes" = "yes" ], which is fine. +# shellcheck disable=SC2050 +if [ "yes" != "@RUN_IN_PLACE@" ]; then echo "This script is only useful on run-in-place systems." return fi @@ -69,7 +71,7 @@ LINUXCNCVERSION="@EMC2VERSION@"; export LINUXCNCVERSION LINUXCNC_NCFILES_DIR="@EMC2_NCFILES_DIR@"; export LINUXCNC_NCFILES_DIR LINUXCNC_EMCSH=@WISH@; export LINUXCNC_EMCSH PATH=@EMC2_BIN_DIR@:$EMC2_HOME/scripts:$EMC2_HOME/tcl:"$PATH" -GLADE_ICON_THEME_PATH=$EMC2_HOME/share/glade/pixmaps:"$GLADE_ICON_THEME_PATH" export GLADE_ICON_THEME_PATH +GLADE_ICON_THEME_PATH=$EMC2_HOME/share/glade/pixmaps:"$GLADE_ICON_THEME_PATH"; export GLADE_ICON_THEME_PATH if [ -z "$TCLLIBPATH" ]; then TCLLIBPATH=$EMC2_HOME/tcl @@ -108,7 +110,7 @@ fi if ! $as_command; then # TODO: if these completion directives give trouble for any versions # of bash actively in use, protect them with checks of BASH_VERSINFO - if [ $BASH_VERSINFO -eq 2 ]; then + if [ "${BASH_VERSINFO[0]}" -eq 2 ]; then complete -o dirnames -f -X '!*.ini' emc axis mdi complete -o dirnames -f -X '!*.hal' halrun halcmd complete -W 'start stop restart status' realtime @@ -127,8 +129,8 @@ if ! $as_command; then complete -C "halcmd -C" halcmd fi - if [ -f $EMC2_HOME/src/Makefile ]; then - build () { make -C $EMC2_HOME/src "$@"; } + if [ -f "$EMC2_HOME/src/Makefile" ]; then + build () { make -C "$EMC2_HOME/src" "$@"; } fi fi diff --git a/scripts/travis-build-test.sh b/scripts/travis-build-test.sh index 2a91ae333fe..667a94930ed 100755 --- a/scripts/travis-build-test.sh +++ b/scripts/travis-build-test.sh @@ -2,7 +2,7 @@ cd src ./autogen.sh ./configure --disable-check-runtime-deps --enable-build-documentation -make -O -j$(getconf _NPROCESSORS_ONLN) manpages V=1 -make -O -j$(getconf _NPROCESSORS_ONLN) translateddocs V=1 -make -O -j$(getconf _NPROCESSORS_ONLN) default pycheck V=1 +make -O -j"$(getconf _NPROCESSORS_ONLN)" manpages V=1 +make -O -j"$(getconf _NPROCESSORS_ONLN)" translateddocs V=1 +make -O -j"$(getconf _NPROCESSORS_ONLN)" default pycheck V=1 ../scripts/rip-environment runtests diff --git a/scripts/version-is-release b/scripts/version-is-release index 9e2cfea5409..b73f963b02e 100755 --- a/scripts/version-is-release +++ b/scripts/version-is-release @@ -8,23 +8,23 @@ # that is signed by the release manager's key. # -if [ ! -z "$EMC2_HOME" ]; then - source $EMC2_HOME/scripts/githelper.sh +if [ -n "$EMC2_HOME" ]; then + source "$EMC2_HOME"/scripts/githelper.sh else - source $(git rev-parse --show-toplevel)/scripts/githelper.sh + source "$(git rev-parse --show-toplevel)"/scripts/githelper.sh fi -githelper $1 +githelper "$1" if [ -z "$GIT_TAG" ]; then # no signed tags found echo "no" exit 1 fi -TAGGED_REV=$(git rev-parse $GIT_TAG^{commit}) +TAGGED_REV=$(git rev-parse "$GIT_TAG^{commit}") HEAD_REV=$(git rev-parse HEAD) -if [ "$TAGGED_REV" == "$HEAD_REV" ]; then +if [ "$TAGGED_REV" = "$HEAD_REV" ]; then echo "yes" exit 0 fi diff --git a/scripts/xhc-hb04-accels b/scripts/xhc-hb04-accels index 4497a6848d0..dad4d3a9d22 100755 --- a/scripts/xhc-hb04-accels +++ b/scripts/xhc-hb04-accels @@ -3,7 +3,7 @@ cat << EOF #------------------------------------------------------------ This obsolete script: - $(basename $0) + $(basename "$0") should be removed from LinuxCNC ini files (effective 2.8~pre) xhc-hb04.tcl now controls reduced wheel jogging accels using diff --git a/share/qtvcp/screens/qtdragon/languages/langfile b/share/qtvcp/screens/qtdragon/languages/langfile index ae06792d9c5..df36da9ca10 100755 --- a/share/qtvcp/screens/qtdragon/languages/langfile +++ b/share/qtvcp/screens/qtdragon/languages/langfile @@ -8,6 +8,6 @@ elif [ ${#1} -ne 2 ]; then exit fi -echo -e '\ncreating language translation file qtdragon_'$1'.ts\n' +echo -e '\ncreating language translation file qtdragon_'"$1"'.ts\n' -pylupdate5 *.py ../*.py -ts qtdragon_$1.ts +pylupdate5 ./*.py ../*.py -ts "qtdragon_$1.ts" diff --git a/share/qtvcp/screens/qtdragon_hd/languages/langfile b/share/qtvcp/screens/qtdragon_hd/languages/langfile index b7af179051c..776253d6361 100755 --- a/share/qtvcp/screens/qtdragon_hd/languages/langfile +++ b/share/qtvcp/screens/qtdragon_hd/languages/langfile @@ -8,6 +8,6 @@ elif [ ${#1} -ne 2 ]; then exit fi -echo -e '\ncreating language translation file qtdragon_hd_'$1'.ts\n' +echo -e '\ncreating language translation file qtdragon_hd_'"$1"'.ts\n' -pylupdate5 *.py ../*.py -ts qtdragon_hd_$1.ts +pylupdate5 ./*.py ../*.py -ts "qtdragon_hd_$1.ts" diff --git a/share/qtvcp/screens/qtdragon_lathe/languages/langfile b/share/qtvcp/screens/qtdragon_lathe/languages/langfile index 852113ec230..c07af65f0e5 100755 --- a/share/qtvcp/screens/qtdragon_lathe/languages/langfile +++ b/share/qtvcp/screens/qtdragon_lathe/languages/langfile @@ -8,6 +8,6 @@ elif [ ${#1} -ne 2 ]; then exit fi -echo -e '\ncreating language translation file qtdragon_lathe_'$1'.ts\n' +echo -e '\ncreating language translation file qtdragon_lathe_'"$1"'.ts\n' -pylupdate5 *.py ../*.py -ts qtdragon_lathe_$1.ts +pylupdate5 ./*.py ../*.py -ts "qtdragon_lathe_$1.ts" diff --git a/share/qtvcp/screens/qtplasmac/languages/langfile b/share/qtvcp/screens/qtplasmac/languages/langfile index bc0cafb0b5e..f3e2eeb812e 100755 --- a/share/qtvcp/screens/qtplasmac/languages/langfile +++ b/share/qtvcp/screens/qtplasmac/languages/langfile @@ -12,4 +12,4 @@ fi echo -e "\ncreating language translation file qtplasmac_$1.ts\n" -pylupdate5 *.py ../*.py ../../../../../lib/python/qtvcp/lib/qtplasmac/*.py -ts qtplasmac_$1.ts +pylupdate5 ./*.py ../*.py ../../../../../lib/python/qtvcp/lib/qtplasmac/*.py -ts "qtplasmac_$1.ts" diff --git a/share/qtvcp/screens/qtplasmac/languages/langlink b/share/qtvcp/screens/qtplasmac/languages/langlink index 109decd4e1e..7a94145c784 100755 --- a/share/qtvcp/screens/qtplasmac/languages/langlink +++ b/share/qtvcp/screens/qtplasmac/languages/langlink @@ -19,8 +19,8 @@ else echo -e "\ncreating links to qtplasmac_$1.qn translation for qtplasmac_4x3 and qtplasmac_9x16\n" mkdir -p "../../qtplasmac_4x3/languages" mkdir -p "../../qtplasmac_9x16/languages" - ln -rs qtplasmac_$1.qm -t ../../qtplasmac_4x3/languages - ln -rs qtplasmac_$1.qm -t ../../qtplasmac_9x16/languages - mv ../../qtplasmac_4x3/languages/qtplasmac_$1.qm ../../qtplasmac_4x3/languages/qtplasmac_4x3_sk.qm - mv ../../qtplasmac_9x16/languages/qtplasmac_$1.qm ../../qtplasmac_9x16/languages/qtplasmac_9x16_sk.qm + ln -rs "qtplasmac_$1.qm" -t ../../qtplasmac_4x3/languages + ln -rs "qtplasmac_$1.qm" -t ../../qtplasmac_9x16/languages + mv "../../qtplasmac_4x3/languages/qtplasmac_$1.qm" ../../qtplasmac_4x3/languages/qtplasmac_4x3_sk.qm + mv "../../qtplasmac_9x16/languages/qtplasmac_$1.qm" ../../qtplasmac_9x16/languages/qtplasmac_9x16_sk.qm fi diff --git a/src/autogen.sh b/src/autogen.sh index 701ca82dd22..11e68c8d3ec 100755 --- a/src/autogen.sh +++ b/src/autogen.sh @@ -4,10 +4,10 @@ AUTOGEN_TARGET=${AUTOGEN_TARGET-configure:config.h.in} set -e case :$AUTOGEN_TARGET: in *:configure:*) - automake_libdir=`automake --print-libdir` - [ -e config.guess ] || cp $automake_libdir/config.guess . - [ -e config.sub ] || cp $automake_libdir/config.sub . - [ -e install-sh ] || cp $automake_libdir/install-sh . + automake_libdir=$(automake --print-libdir) + [ -e config.guess ] || cp "$automake_libdir/config.guess" . + [ -e config.sub ] || cp "$automake_libdir/config.sub" . + [ -e install-sh ] || cp "$automake_libdir/install-sh" . aclocal --force autoconf # autoconf only updates the timestamp if the output actually changed. diff --git a/tests/ccomp/lathe-comp/test.sh b/tests/ccomp/lathe-comp/test.sh index b631a39327a..f74438f2b88 100644 --- a/tests/ccomp/lathe-comp/test.sh +++ b/tests/ccomp/lathe-comp/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -t test.tbl -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/ccomp/mill-g90g91g92/test.sh b/tests/ccomp/mill-g90g91g92/test.sh index b631a39327a..f74438f2b88 100644 --- a/tests/ccomp/mill-g90g91g92/test.sh +++ b/tests/ccomp/mill-g90g91g92/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -t test.tbl -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/ccomp/mill-line-arc-entry/test.sh b/tests/ccomp/mill-line-arc-entry/test.sh index b631a39327a..f74438f2b88 100644 --- a/tests/ccomp/mill-line-arc-entry/test.sh +++ b/tests/ccomp/mill-line-arc-entry/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -t test.tbl -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/ccomp/mill-zchanges/test.sh b/tests/ccomp/mill-zchanges/test.sh index b631a39327a..f74438f2b88 100644 --- a/tests/ccomp/mill-zchanges/test.sh +++ b/tests/ccomp/mill-zchanges/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -t test.tbl -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/classicladder/estop/checkresult b/tests/classicladder/estop/checkresult index 4ad0f2d568f..12395f0c429 100755 --- a/tests/classicladder/estop/checkresult +++ b/tests/classicladder/estop/checkresult @@ -2,7 +2,7 @@ result=$1 -if grep -qi error: $result ; then +if grep -qi error: "$result" ; then echo "found string 'error' in $result" exit 1 fi diff --git a/tests/classicladder/estop/test.sh b/tests/classicladder/estop/test.sh index 2affbde136c..28fed652630 100755 --- a/tests/classicladder/estop/test.sh +++ b/tests/classicladder/estop/test.sh @@ -7,4 +7,4 @@ if [ "libeatmydata.so" = "$LD_PRELOAD" ] ; then unset LD_PRELOAD fi -exec linuxcnc $(dirname $0)/classicladder-estop.ini +exec linuxcnc "$(dirname "$0")/classicladder-estop.ini" diff --git a/tests/halcompile/extralib/checkresult b/tests/halcompile/extralib/checkresult index 610bf2cbf08..b4f3cc1a643 100755 --- a/tests/halcompile/extralib/checkresult +++ b/tests/halcompile/extralib/checkresult @@ -1,2 +1,2 @@ #!/bin/sh -[ -x "`dirname "$1"`/extralib_test" ] +[ -x "$(dirname "$1")/extralib_test" ] diff --git a/tests/halcompile/userspace/checkresult b/tests/halcompile/userspace/checkresult index 6936818f423..f5d9795d155 100755 --- a/tests/halcompile/userspace/checkresult +++ b/tests/halcompile/userspace/checkresult @@ -1,2 +1,2 @@ #!/bin/sh -[ -x $(dirname $1)/rand_test ] +[ -x "$(dirname "$1")/rand_test" ] diff --git a/tests/interp/cam-nisley/test.sh b/tests/interp/cam-nisley/test.sh index 3ee34072b1b..4440735bfae 100644 --- a/tests/interp/cam-nisley/test.sh +++ b/tests/interp/cam-nisley/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -t test.tbl -g cam.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/crazy-paths/test.sh b/tests/interp/crazy-paths/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/crazy-paths/test.sh +++ b/tests/interp/crazy-paths/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/do-while-break/test.sh b/tests/interp/do-while-break/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/do-while-break/test.sh +++ b/tests/interp/do-while-break/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/exists/test.sh b/tests/interp/exists/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/exists/test.sh +++ b/tests/interp/exists/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/flowsnake/test.sh b/tests/interp/flowsnake/test.sh index 68e5ed2082f..18893aab433 100644 --- a/tests/interp/flowsnake/test.sh +++ b/tests/interp/flowsnake/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g flowsnake.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/fractional-linenumbers/test.sh b/tests/interp/fractional-linenumbers/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/fractional-linenumbers/test.sh +++ b/tests/interp/fractional-linenumbers/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g10/g10-l1-l10/test.sh b/tests/interp/g10/g10-l1-l10/test.sh index 29ef11d7a75..52077f363e2 100755 --- a/tests/interp/g10/g10-l1-l10/test.sh +++ b/tests/interp/g10/g10-l1-l10/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc -t test.tbl | awk '{$1=""; print}' | sed 's/-0\.0000/0.0000/g' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g10/g10-l11/test.sh b/tests/interp/g10/g10-l11/test.sh index 29ef11d7a75..52077f363e2 100755 --- a/tests/interp/g10/g10-l11/test.sh +++ b/tests/interp/g10/g10-l11/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc -t test.tbl | awk '{$1=""; print}' | sed 's/-0\.0000/0.0000/g' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g10/g10-l2-while-active/test.sh b/tests/interp/g10/g10-l2-while-active/test.sh index 83d69e365c8..2afa80d1ca5 100755 --- a/tests/interp/g10/g10-l2-while-active/test.sh +++ b/tests/interp/g10/g10-l2-while-active/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g10/g10-l20-while-active/test.sh b/tests/interp/g10/g10-l20-while-active/test.sh index 6d4141e75aa..65bddf51a33 100755 --- a/tests/interp/g10/g10-l20-while-active/test.sh +++ b/tests/interp/g10/g10-l20-while-active/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' | sed 's/-0\.0000/0.0000/g' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g10/g10-with-g92/test.sh b/tests/interp/g10/g10-with-g92/test.sh index 8fa0c30ded8..69ec8bee746 100755 --- a/tests/interp/g10/g10-with-g92/test.sh +++ b/tests/interp/g10/g10-with-g92/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc -t test.tbl | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g33.1/test.sh b/tests/interp/g33.1/test.sh index 5a9af07688e..574a4921f8a 100644 --- a/tests/interp/g33.1/test.sh +++ b/tests/interp/g33.1/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g33.1.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g6164/test.sh b/tests/interp/g6164/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/g6164/test.sh +++ b/tests/interp/g6164/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g76/test.sh b/tests/interp/g76/test.sh index e5c98955404..1993dcb1c88 100644 --- a/tests/interp/g76/test.sh +++ b/tests/interp/g76/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -t test.tbl -g g76only.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g81/g17/g98/test.sh b/tests/interp/g81/g17/g98/test.sh index 3aa65b53475..214cd02540e 100644 --- a/tests/interp/g81/g17/g98/test.sh +++ b/tests/interp/g81/g17/g98/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g17-g98-g81.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g81/g17/g99/test.sh b/tests/interp/g81/g17/g99/test.sh index 466c7243a0c..f4f8fec3660 100644 --- a/tests/interp/g81/g17/g99/test.sh +++ b/tests/interp/g81/g17/g99/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g17-g99-g81.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g81/g18/g98/test.sh b/tests/interp/g81/g18/g98/test.sh index 8828e2e9319..056ffb5014e 100644 --- a/tests/interp/g81/g18/g98/test.sh +++ b/tests/interp/g81/g18/g98/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g18-g98-g81.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g81/g18/g99/test.sh b/tests/interp/g81/g18/g99/test.sh index 4de0eb0743c..1eba671e2f8 100644 --- a/tests/interp/g81/g18/g99/test.sh +++ b/tests/interp/g81/g18/g99/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g18-g99-g81.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g81/g19/g98/test.sh b/tests/interp/g81/g19/g98/test.sh index d4f14b95f46..a10d41f6953 100644 --- a/tests/interp/g81/g19/g98/test.sh +++ b/tests/interp/g81/g19/g98/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g19-g98-g81.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g81/g19/g99/test.sh b/tests/interp/g81/g19/g99/test.sh index 69187669c25..ef2c0ac2ac0 100644 --- a/tests/interp/g81/g19/g99/test.sh +++ b/tests/interp/g81/g19/g99/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g19-g99-g81.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g84/g17/g98/test.sh b/tests/interp/g84/g17/g98/test.sh index 601e4ada81f..5a43938a92b 100755 --- a/tests/interp/g84/g17/g98/test.sh +++ b/tests/interp/g84/g17/g98/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g17-g98-g84.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g84/g17/g99/test.sh b/tests/interp/g84/g17/g99/test.sh index ab358fce49a..5b95133f8e3 100644 --- a/tests/interp/g84/g17/g99/test.sh +++ b/tests/interp/g84/g17/g99/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g17-g99-g84.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g84/g18/g98/test.sh b/tests/interp/g84/g18/g98/test.sh index 9110de97652..0b60af3801d 100644 --- a/tests/interp/g84/g18/g98/test.sh +++ b/tests/interp/g84/g18/g98/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g18-g98-g84.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g84/g18/g99/test.sh b/tests/interp/g84/g18/g99/test.sh index b7008b70fb0..f946371d20e 100644 --- a/tests/interp/g84/g18/g99/test.sh +++ b/tests/interp/g84/g18/g99/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g18-g99-g84.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g84/g19/g98/test.sh b/tests/interp/g84/g19/g98/test.sh index 9b0806ee414..4545239caee 100644 --- a/tests/interp/g84/g19/g98/test.sh +++ b/tests/interp/g84/g19/g98/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g19-g98-g84.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/g84/g19/g99/test.sh b/tests/interp/g84/g19/g99/test.sh index 16e5a42673a..e82c38e1084 100644 --- a/tests/interp/g84/g19/g99/test.sh +++ b/tests/interp/g84/g19/g99/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g19-g99-g84.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/inside-corners/test.sh b/tests/interp/inside-corners/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/inside-corners/test.sh +++ b/tests/interp/inside-corners/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/inverse-time-with-comp/test.sh b/tests/interp/inverse-time-with-comp/test.sh index 9279a98e2f2..cec720fe1f7 100644 --- a/tests/interp/inverse-time-with-comp/test.sh +++ b/tests/interp/inverse-time-with-comp/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g inverse.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/m19/test.sh b/tests/interp/m19/test.sh index da351514599..22f60fd0ac7 100644 --- a/tests/interp/m19/test.sh +++ b/tests/interp/m19/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -n 0 -i test.ini -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/m98m99/01-basics/test.sh b/tests/interp/m98m99/01-basics/test.sh index 83d69e365c8..2afa80d1ca5 100755 --- a/tests/interp/m98m99/01-basics/test.sh +++ b/tests/interp/m98m99/01-basics/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/m98m99/02-variables/test.sh b/tests/interp/m98m99/02-variables/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/m98m99/02-variables/test.sh +++ b/tests/interp/m98m99/02-variables/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/m98m99/05-M98-loops/test.sh b/tests/interp/m98m99/05-M98-loops/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/m98m99/05-M98-loops/test.sh +++ b/tests/interp/m98m99/05-M98-loops/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/m98m99/07-nested-subs/test.sh b/tests/interp/m98m99/07-nested-subs/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/m98m99/07-nested-subs/test.sh +++ b/tests/interp/m98m99/07-nested-subs/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/m98m99/08-sub-follows-main/test.sh b/tests/interp/m98m99/08-sub-follows-main/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/m98m99/08-sub-follows-main/test.sh +++ b/tests/interp/m98m99/08-sub-follows-main/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/m98m99/10-M98-P001/test.sh b/tests/interp/m98m99/10-M98-P001/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/m98m99/10-M98-P001/test.sh +++ b/tests/interp/m98m99/10-M98-P001/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/m98m99/11-main-program-oword/test.sh b/tests/interp/m98m99/11-main-program-oword/test.sh index 448dc119130..34c1b2b1f71 100644 --- a/tests/interp/m98m99/11-main-program-oword/test.sh +++ b/tests/interp/m98m99/11-main-program-oword/test.sh @@ -18,7 +18,7 @@ ILLEGAL_TESTS=" # for t in $LEGAL_TESTS; do echo "Legal test ${t}:" - rs274 -g test-legal-${t}.ngc | awk '{$1=""; print}' + rs274 -g "test-legal-${t}.ngc" | awk '{$1=""; print}' res=${PIPESTATUS[0]} if test "$res" = 0; then echo "Success: Test '${t}' exited ${res}" >&2 @@ -33,7 +33,7 @@ done for t in $ILLEGAL_TESTS; do echo "Illegal test ${t}:" res=-1 - rs274 -g test-illegal-${t}.ngc | awk '{$1=""; print}' + rs274 -g "test-illegal-${t}.ngc" | awk '{$1=""; print}' res=${PIPESTATUS[0]} if test "$res" = 0; then echo "Error: Illegal test '${t}' exited ${res}" >&2 diff --git a/tests/interp/m98m99/12-M99-endless-main-program/test.sh b/tests/interp/m98m99/12-M99-endless-main-program/test.sh index 9a0ef1271f3..7ef57534546 100755 --- a/tests/interp/m98m99/12-M99-endless-main-program/test.sh +++ b/tests/interp/m98m99/12-M99-endless-main-program/test.sh @@ -7,4 +7,4 @@ linuxcnc -r motion-logger.ini # Run test file in stand-alone interpreter: should run program once rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/magic_comments/param_format_printing/test.sh b/tests/interp/magic_comments/param_format_printing/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/magic_comments/param_format_printing/test.sh +++ b/tests/interp/magic_comments/param_format_printing/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/namedparam-bug424/test.sh b/tests/interp/namedparam-bug424/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/namedparam-bug424/test.sh +++ b/tests/interp/namedparam-bug424/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/oword-bug315-p2/test.sh b/tests/interp/oword-bug315-p2/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/oword-bug315-p2/test.sh +++ b/tests/interp/oword-bug315-p2/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/oword-bug315/test.sh b/tests/interp/oword-bug315/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/oword-bug315/test.sh +++ b/tests/interp/oword-bug315/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/oword-unwind/test.sh b/tests/interp/oword-unwind/test.sh index da351514599..22f60fd0ac7 100644 --- a/tests/interp/oword-unwind/test.sh +++ b/tests/interp/oword-unwind/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -n 0 -i test.ini -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/plug/absolute/test.sh b/tests/interp/plug/absolute/test.sh index 7d29952328b..7044c07bf33 100644 --- a/tests/interp/plug/absolute/test.sh +++ b/tests/interp/plug/absolute/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -p "${LIBDIR}"/linuxcnc/canterp.so -g canon | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/plug/filename/test.sh b/tests/interp/plug/filename/test.sh index 40043f9edd3..e6c1a20e9a4 100644 --- a/tests/interp/plug/filename/test.sh +++ b/tests/interp/plug/filename/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -p canterp.so -g canon | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/plug/relative/test.sh b/tests/interp/plug/relative/test.sh index defb33cfdb0..55db7ddb4b5 100644 --- a/tests/interp/plug/relative/test.sh +++ b/tests/interp/plug/relative/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -p ./canterp.so -g canon | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/python/error/checkresult b/tests/interp/python/error/checkresult index 1c9f2d03137..796ccb36769 100755 --- a/tests/interp/python/error/checkresult +++ b/tests/interp/python/error/checkresult @@ -1,2 +1,2 @@ #!/bin/sh -grep -q -F 'Radius to end of arc differs from radius to start:' $1 +grep -q -F 'Radius to end of arc differs from radius to start:' "$1" diff --git a/tests/interp/return-value/test.sh b/tests/interp/return-value/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/return-value/test.sh +++ b/tests/interp/return-value/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/rotation/abs-pts/test.sh b/tests/interp/rotation/abs-pts/test.sh index 5b214441322..53e9013752c 100644 --- a/tests/interp/rotation/abs-pts/test.sh +++ b/tests/interp/rotation/abs-pts/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc -t test.tbl | awk '/MESSAGE/ {$1=""; print}' | sed 's/-0\.0000/0.0000/g' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/rotation/g28/test.sh b/tests/interp/rotation/g28/test.sh index 33218bea6ab..998595ed67e 100755 --- a/tests/interp/rotation/g28/test.sh +++ b/tests/interp/rotation/g28/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g28.ngc | sed 's/-0\.0000/0.0000/g' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/rotation/g53/test.sh b/tests/interp/rotation/g53/test.sh index ac5b7fe17a5..8ced2f78e4b 100755 --- a/tests/interp/rotation/g53/test.sh +++ b/tests/interp/rotation/g53/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g g53.ngc | sed 's/-0\.0000/0.0000/g' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/interp/subs-follow-main/test.sh b/tests/interp/subs-follow-main/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/interp/subs-follow-main/test.sh +++ b/tests/interp/subs-follow-main/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/linuxcncrsh-tcp/subs/M100 b/tests/linuxcncrsh-tcp/subs/M100 index 77d6be2b712..ab0e0d2f1a0 100755 --- a/tests/linuxcncrsh-tcp/subs/M100 +++ b/tests/linuxcncrsh-tcp/subs/M100 @@ -15,6 +15,6 @@ OUT_FILE=$TEST_DIR/gcode-output P=$1 Q=$2 -echo P is $P >> $OUT_FILE -echo Q is $Q >> $OUT_FILE +echo "P is $P" >> "$OUT_FILE" +echo "Q is $Q" >> "$OUT_FILE" diff --git a/tests/linuxcncrsh-tcp/test.sh b/tests/linuxcncrsh-tcp/test.sh index a8da4840ac4..9683b8e7eb6 100755 --- a/tests/linuxcncrsh-tcp/test.sh +++ b/tests/linuxcncrsh-tcp/test.sh @@ -13,41 +13,41 @@ linuxcnc -r linuxcncrsh-test.ini & # let linuxcnc come up TOGO=80 while [ $TOGO -gt 0 ]; do - echo trying to connect to linuxcncrsh TOGO=$TOGO + echo "trying to connect to linuxcncrsh TOGO=$TOGO" if nc -z localhost 5007; then break fi sleep 0.25 - TOGO=$(($TOGO - 1)) + TOGO=$((TOGO - 1)) done if [ $TOGO -eq 0 ]; then - echo connection to linuxcncrsh timed out + echo "connection to linuxcncrsh timed out" exit 1 fi ( - echo hello EMC mt 1.0 - echo set enable EMCTOO + echo "hello EMC mt 1.0" + echo "set enable EMCTOO" # ask linuxcncrsh to not read the next command until it's done running # the current one - echo set set_wait done + echo "set set_wait done" - echo set mode manual - echo set estop off - echo set machine on + echo "set mode manual" + echo "set estop off" + echo "set machine on" - echo set mode mdi - echo set mdi m100 p-1 q-2 + echo "set mode mdi" + echo "set mdi m100 p-1 q-2" sleep 1 # here comes a big blob dd bs=4096 if=lots-of-gcode - echo set mdi m100 p-3 q-4 + echo "set mdi m100 p-3 q-4" - echo shutdown + echo "shutdown" ) | nc localhost 5007 diff --git a/tests/linuxcncrsh/subs/M100 b/tests/linuxcncrsh/subs/M100 index 77d6be2b712..ab0e0d2f1a0 100755 --- a/tests/linuxcncrsh/subs/M100 +++ b/tests/linuxcncrsh/subs/M100 @@ -15,6 +15,6 @@ OUT_FILE=$TEST_DIR/gcode-output P=$1 Q=$2 -echo P is $P >> $OUT_FILE -echo Q is $Q >> $OUT_FILE +echo "P is $P" >> "$OUT_FILE" +echo "Q is $Q" >> "$OUT_FILE" diff --git a/tests/m70-m73/m70m72-restore.0/test.sh b/tests/m70-m73/m70m72-restore.0/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/m70-m73/m70m72-restore.0/test.sh +++ b/tests/m70-m73/m70m72-restore.0/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/m70-m73/m73-flood-mist-restore.0/test.sh b/tests/m70-m73/m73-flood-mist-restore.0/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/m70-m73/m73-flood-mist-restore.0/test.sh +++ b/tests/m70-m73/m73-flood-mist-restore.0/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/m70-m73/m73autorestore.0/test.sh b/tests/m70-m73/m73autorestore.0/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/m70-m73/m73autorestore.0/test.sh +++ b/tests/m70-m73/m73autorestore.0/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/mb2hal/mb2hal.1a/checkresult b/tests/mb2hal/mb2hal.1a/checkresult index e9b32e7c804..239e74506f3 100755 --- a/tests/mb2hal/mb2hal.1a/checkresult +++ b/tests/mb2hal/mb2hal.1a/checkresult @@ -1,7 +1,7 @@ #!/bin/bash set -e -TESTDIR=$(dirname $1) +TESTDIR=$(dirname "$1") cd "${TESTDIR}" # HAL assigns each component a unique component ID at load-time. diff --git a/tests/mb2hal/mb2hal.1b/checkresult b/tests/mb2hal/mb2hal.1b/checkresult index 4d5cba97b00..39dde14e13a 100755 --- a/tests/mb2hal/mb2hal.1b/checkresult +++ b/tests/mb2hal/mb2hal.1b/checkresult @@ -1,7 +1,7 @@ #!/bin/bash set -e -TESTDIR=$(dirname $1) +TESTDIR=$(dirname "$1") cd "${TESTDIR}" # HAL assigns each component a unique component ID at load-time. diff --git a/tests/mb2hal/mb2hal.2a/checkresult b/tests/mb2hal/mb2hal.2a/checkresult index e9b32e7c804..239e74506f3 100755 --- a/tests/mb2hal/mb2hal.2a/checkresult +++ b/tests/mb2hal/mb2hal.2a/checkresult @@ -1,7 +1,7 @@ #!/bin/bash set -e -TESTDIR=$(dirname $1) +TESTDIR=$(dirname "$1") cd "${TESTDIR}" # HAL assigns each component a unique component ID at load-time. diff --git a/tests/mb2hal/mb2hal.2b/checkresult b/tests/mb2hal/mb2hal.2b/checkresult index 4d5cba97b00..39dde14e13a 100755 --- a/tests/mb2hal/mb2hal.2b/checkresult +++ b/tests/mb2hal/mb2hal.2b/checkresult @@ -1,7 +1,7 @@ #!/bin/bash set -e -TESTDIR=$(dirname $1) +TESTDIR=$(dirname "$1") cd "${TESTDIR}" # HAL assigns each component a unique component ID at load-time. diff --git a/tests/mdi-queue/subs/M100 b/tests/mdi-queue/subs/M100 index 85f6204dca8..20e1906d210 100755 --- a/tests/mdi-queue/subs/M100 +++ b/tests/mdi-queue/subs/M100 @@ -13,5 +13,5 @@ OUT_FILE=$TEST_DIR/gcode-output P=$1 -echo P is $P >> $OUT_FILE +echo "P is $P" >> "$OUT_FILE" diff --git a/tests/module-loading/rtapi-app-main-fails/checkresult b/tests/module-loading/rtapi-app-main-fails/checkresult index 5b646386e8d..559b534ae51 100755 --- a/tests/module-loading/rtapi-app-main-fails/checkresult +++ b/tests/module-loading/rtapi-app-main-fails/checkresult @@ -1,19 +1,19 @@ #!/bin/sh -STDERR=$(dirname $1)/stderr -if [ ! -f $STDERR ]; then +STDERR=$(dirname "$1")/stderr +if [ ! -f "$STDERR" ]; then echo "stderr file not found!" exit 1 fi # Linux spelling of ERANGE -if grep -E -q 'rtapi_app_main_fails.* Numerical result out of range' $STDERR; then +if grep -E -q 'rtapi_app_main_fails.* Numerical result out of range' "$STDERR"; then echo "loadrt found the test component, and it failed to load" exit 0 fi # FreeBSD spelling of ERANGE -if grep -E -q 'rtapi_app_main_fails.* Result too large' $STDERR; then +if grep -E -q 'rtapi_app_main_fails.* Result too large' "$STDERR"; then echo "loadrt found the test component, and it failed to load" exit 0 fi diff --git a/tests/module-loading/shared-test.sh b/tests/module-loading/shared-test.sh index 4f5780138b4..79730d54d6c 100644 --- a/tests/module-loading/shared-test.sh +++ b/tests/module-loading/shared-test.sh @@ -3,13 +3,13 @@ halrun setup.hal > hal-output 2>&1 RESULT=$? -NUM_PINS=$(cat hal-output | grep -E $(cat PIN_NAME_REGEX) | wc -l) +NUM_PINS=$(grep -Ec "$(cat PIN_NAME_REGEX)" hal-output) -if [ $RESULT -ne $(cat RESULT) ]; then +if [ $RESULT -ne "$(cat RESULT)" ]; then exit 1 fi -if [ "$NUM_PINS" -ne $(cat NUM_PINS) ]; then +if [ "$NUM_PINS" -ne "$(cat NUM_PINS)" ]; then exit 1 fi diff --git a/tests/motion/g0/test.sh b/tests/motion/g0/test.sh index b54482c459d..ed4c5741ad3 100755 --- a/tests/motion/g0/test.sh +++ b/tests/motion/g0/test.sh @@ -8,14 +8,14 @@ wait_for_pin() { value="$2" maxwait=10 # seconds while [ 0 -lt $maxwait ] \ - && [ "$value" != "$(halcmd -s show pin $pin | awk '{print $4}')" ]; do + && [ "$value" != "$(halcmd -s show pin "$pin" | awk '{print $4}')" ]; do sleep 1 - maxwait=$(($maxwait -1)) + maxwait=$((maxwait - 1)) done if [ 0 -eq $maxwait ] ; then - echo "error: waiting for pin $pin timed out" - kill $linuxcncpid - kill $samplerpid + echo "E: waiting for pin $pin timed out" + kill "$linuxcncpid" + kill "$samplerpid" exit 1 fi } @@ -26,49 +26,49 @@ linuxcncpid=$! # let linuxcnc come up TOGO=80 while [ $TOGO -gt 0 ]; do - echo trying to connect to linuxcncrsh TOGO=$TOGO + echo "I: trying to connect to linuxcncrsh TOGO=$TOGO" if nc -z localhost 5007; then break fi sleep 0.25 - TOGO=$(($TOGO - 1)) + TOGO=$((TOGO - 1)) done if [ $TOGO -eq 0 ]; then - echo connection to linuxcncrsh timed out + echo "I: connection to linuxcncrsh timed out" exit 1 fi wait_for_pin motion.in-position TRUE -echo starting to capture data +echo "I: starting to capture data" halsampler -t >| result.halsamples & samplerpid=$! ( - echo hello EMC mt 1.0 - echo set enable EMCTOO + echo "hello EMC mt 1.0" + echo "set enable EMCTOO" - echo set estop off - echo set machine on + echo "set estop off" + echo "set machine on" - echo set mode mdi + echo "set mode mdi" dist=1 - echo set mdi g0x$dist + echo "set mdi g0x$dist" # Wait for movement to complete wait_for_pin joint.0.pos-fb $dist wait_for_pin joint.0.in-position TRUE wait_for_pin joint.1.in-position TRUE - echo shutdown + echo "shutdown" ) | nc localhost 5007 -kill $samplerpid -wait $samplerpid -echo finished capturing data +kill "$samplerpid" +wait "$samplerpid" +echo "I: finished capturing data" # wait for linuxcnc to finish -wait $linuxcncpid +wait "$linuxcncpid" exit 0 diff --git a/tests/overrun/checkresult b/tests/overrun/checkresult index f398da1a04a..b64faf30722 100755 --- a/tests/overrun/checkresult +++ b/tests/overrun/checkresult @@ -1,5 +1,5 @@ #!/bin/sh set -e -grep -q "overrun detected in sampler" $1 -grep -q "10 overruns detected, giving up" $1 -grep -q "1 tests run, 0 successful, 1 failed . 0 expected" $1 +grep -q "overrun detected in sampler" "$1" +grep -q "10 overruns detected, giving up" "$1" +grep -q "1 tests run, 0 successful, 1 failed . 0 expected" "$1" diff --git a/tests/oword/sub.0/test.sh b/tests/oword/sub.0/test.sh index 83d69e365c8..2afa80d1ca5 100644 --- a/tests/oword/sub.0/test.sh +++ b/tests/oword/sub.0/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/oword/while.0/test.sh b/tests/oword/while.0/test.sh index 83d69e365c8..2afa80d1ca5 100755 --- a/tests/oword/while.0/test.sh +++ b/tests/oword/while.0/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/remap/duplicate-o-word/test.sh b/tests/remap/duplicate-o-word/test.sh index 13adf7d5cf6..99269de600c 100755 --- a/tests/remap/duplicate-o-word/test.sh +++ b/tests/remap/duplicate-o-word/test.sh @@ -1,4 +1,4 @@ #!/bin/bash export INI_FILE_NAME=test.ini -rs274 -i $INI_FILE_NAME -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +rs274 -i "$INI_FILE_NAME" -g test.ngc | awk '{$1=""; print}' +exit "${PIPESTATUS[0]}" diff --git a/tests/remap/fail/args.0/test.sh b/tests/remap/fail/args.0/test.sh index 65d4d349dfe..bb2a78ea3d5 100755 --- a/tests/remap/fail/args.0/test.sh +++ b/tests/remap/fail/args.0/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -i test.ini -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/remap/fail/args.1/test.sh b/tests/remap/fail/args.1/test.sh index 77a112a15ca..974f6975c31 100755 --- a/tests/remap/fail/args.1/test.sh +++ b/tests/remap/fail/args.1/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -i test.ini -n 0 -g test.ngc 2>&1 -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/remap/fail/args.2/test.sh b/tests/remap/fail/args.2/test.sh index 77a112a15ca..974f6975c31 100755 --- a/tests/remap/fail/args.2/test.sh +++ b/tests/remap/fail/args.2/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -i test.ini -n 0 -g test.ngc 2>&1 -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/remap/fail/body-ngc/test.sh b/tests/remap/fail/body-ngc/test.sh index 77a112a15ca..974f6975c31 100755 --- a/tests/remap/fail/body-ngc/test.sh +++ b/tests/remap/fail/body-ngc/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -i test.ini -n 0 -g test.ngc 2>&1 -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/remap/m30-interaction/test.sh b/tests/remap/m30-interaction/test.sh index 57e28aba8d2..a3af97b0369 100755 --- a/tests/remap/m30-interaction/test.sh +++ b/tests/remap/m30-interaction/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -i test.ini -g test.ngc 2>&1 | sed 's/^ *[0-9]* //' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/remap/nested-remaps-oword/test.sh b/tests/remap/nested-remaps-oword/test.sh index 21d662fe18f..a3af97b0369 100755 --- a/tests/remap/nested-remaps-oword/test.sh +++ b/tests/remap/nested-remaps-oword/test.sh @@ -1,4 +1,3 @@ #!/bin/bash rs274 -i test.ini -g test.ngc 2>&1 | sed 's/^ *[0-9]* //' -exit ${PIPESTATUS[0]} - +exit "${PIPESTATUS[0]}" diff --git a/tests/remap/posargs.0/test.sh b/tests/remap/posargs.0/test.sh index 087b90d47b6..c4f19fb4f54 100755 --- a/tests/remap/posargs.0/test.sh +++ b/tests/remap/posargs.0/test.sh @@ -1,3 +1,3 @@ #!/bin/bash rs274 -i test.ini -n 0 -g test.ngc| awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/remap/remap-reentry/test.sh b/tests/remap/remap-reentry/test.sh index 02f782fcdd5..2e101d82b63 100755 --- a/tests/remap/remap-reentry/test.sh +++ b/tests/remap/remap-reentry/test.sh @@ -1,3 +1,3 @@ #!/bin/bash -e rs274 -g -i test.ini test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" diff --git a/tests/remap/sequencing/test.sh b/tests/remap/sequencing/test.sh index 13adf7d5cf6..99269de600c 100755 --- a/tests/remap/sequencing/test.sh +++ b/tests/remap/sequencing/test.sh @@ -1,4 +1,4 @@ #!/bin/bash export INI_FILE_NAME=test.ini -rs274 -i $INI_FILE_NAME -g test.ngc | awk '{$1=""; print}' -exit ${PIPESTATUS[0]} +rs274 -i "$INI_FILE_NAME" -g test.ngc | awk '{$1=""; print}' +exit "${PIPESTATUS[0]}" diff --git a/tests/rtapi_printf.0/checkresult b/tests/rtapi_printf.0/checkresult index a5579640371..30bfaa64cae 100755 --- a/tests/rtapi_printf.0/checkresult +++ b/tests/rtapi_printf.0/checkresult @@ -1,2 +1,2 @@ #!/bin/sh -! grep -q '\*fail\*' $1 +! grep -q '\*fail\*' "$1" diff --git a/tests/stepgen.2/checkresult b/tests/stepgen.2/checkresult index 809e8044c40..663fd3796b8 100755 --- a/tests/stepgen.2/checkresult +++ b/tests/stepgen.2/checkresult @@ -1,7 +1,9 @@ #!/bin/bash COUNT=0 -while read i j; do - if [ $j -eq 1 ]; then COUNT=$((COUNT+1)); fi -done < $1 +# Variable i is unused +# shellcheck disable=SC2034 +while read -r i j; do + if [ "$j" -eq 1 ]; then COUNT=$((COUNT+1)); fi +done < "$1" test $COUNT -eq 1280 diff --git a/tests/t0/shared-test.sh b/tests/t0/shared-test.sh index c2f4b67176b..efbea56c142 100644 --- a/tests/t0/shared-test.sh +++ b/tests/t0/shared-test.sh @@ -25,7 +25,7 @@ while [ $TOGO -gt 0 ]; do break fi sleep 0.25 - TOGO=$(($TOGO - 1)) + TOGO=$((TOGO - 1)) done if [ $TOGO -eq 0 ]; then echo connection to linuxcncrsh timed out @@ -47,12 +47,12 @@ fi echo 'set wait done' } - echo hello EMC mt 1.0 - echo set enable EMCTOO + echo "hello EMC mt 1.0" + echo "set enable EMCTOO" - echo set estop off - echo set machine on - echo set mode mdi + echo "set estop off" + echo "set machine on" + echo "set mode mdi" # @@ -77,12 +77,12 @@ fi # Apply the TLO of the current tool. On both, the spindle has no tool, # which has 0 TLO. - echo set mdi g43 + echo "set mdi g43" introspect 1 # Apply the TLO of tool T1. On both, T1 is a valid tool, so we use its # TLO. - echo set mdi g43 h1 + echo "set mdi g43 h1" introspect 2 # Apply the TLO of H0, this one is weird. @@ -94,7 +94,7 @@ fi # table, this is an error and the active TLO remains unchanged (so it # stays as the TLO of T1 that we just set above). If T0 is defined, we # apply its TLO here. - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 3 @@ -104,18 +104,18 @@ fi # Try to change TLO of the normal tool T7. This should work on both, # but not change the active TLO. - echo set mdi g10 l1 p7 z0.1 + echo "set mdi g10 l1 p7 z0.1" introspect 4 # Apply the TLO of T7, which we just tried to set. This should work on # both. - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 5 # Try to change TLO of the strange tool T0. # # This should fail in every config because you cannot change T0. - echo set mdi g10 l1 p0 z0.2 + echo "set mdi g10 l1 p0 z0.2" introspect 6 # Apply the TLO of the special H0. @@ -127,7 +127,7 @@ fi # table, this is an error and the active TLO remains unchanged (so it # stays as the TLO of T7 that we just set above). If T0 is defined, we # apply its TLO here. - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 7 @@ -136,18 +136,18 @@ fi # # Try to change TLO of the normal tool T7. This should work on both. - echo set mdi g10 l10 p7 z0.3 + echo "set mdi g10 l10 p7 z0.3" introspect 8 # Apply the TLO of T7, which we just tried to set. This should work on # both. - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 9 # Try to change TLO of the strange tool T0. # # This should fail on every config because you cannot change T0. - echo set mdi g10 l10 p0 z0.4 + echo "set mdi g10 l10 p0 z0.4" introspect 10 # Apply the TLO of the special H0. @@ -159,7 +159,7 @@ fi # table, this is an error and the active TLO remains unchanged (so it # stays as the TLO of T7 that we just set above). If T0 is defined, we # apply its TLO here. - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 11 @@ -184,13 +184,13 @@ fi # random with T0: -5.0 + 0.0 TLO = -5.0 # # All the configs will be at Z=5.0 after switching to G59.3. - echo set mdi g10 l20 p9 z5 + echo "set mdi g10 l20 p9 z5" introspect 11.5 - echo set mdi g59.3 + echo "set mdi g59.3" introspect 12 - echo set mdi g54 + echo "set mdi g54" introspect 13 # Try to change TLO of the normal tool T7. This should work on all @@ -202,18 +202,18 @@ fi # Random with T0: -5.0 + 0.5 = -4.5 # # But these offsets are not active until the G43 below. - echo set mdi g10 l11 p7 z0.5 + echo "set mdi g10 l11 p7 z0.5" introspect 14 # Apply the TLO of T7, which we just tried to set. This should # work on all configs. - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 15 # Try to change TLO of the strange tool T0. # # This should fail on every config because you cannot change T0. - echo set mdi g10 l11 p0 z0.6 + echo "set mdi g10 l11 p0 z0.6" introspect 16 # Apply the TLO of the special H0. @@ -225,7 +225,7 @@ fi # table, this is an error and the active TLO remains unchanged (so it # stays as the TLO of T7 that we just set above). If T0 is defined, we # apply its TLO here. - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 17 @@ -242,7 +242,7 @@ fi # Switch to the valid tool T50 but don't apply its TLO yet. # This should work on all configs. - echo set mdi t50 m6 + echo "set mdi t50 m6" introspect 100 @@ -252,17 +252,17 @@ fi # Apply the TLO of the current tool. On all configs, the spindle has # T50. This should work on all configs. - echo set mdi g43 + echo "set mdi g43" introspect 101 # change the TLO of the normal tool T7 # this should work on both, but not change the active TLO - echo set mdi g10 l10 p7 z1.1 + echo "set mdi g10 l10 p7 z1.1" introspect 102 # apply the TLO of the normal tool T7 (TLO of 0.5 set above) # this should work on both - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 103 # try to change the TLO of T0 @@ -272,7 +272,7 @@ fi # On random without T0 this should fail because there is no T0. # # On random with T0 this should fail because you can't change T0. - echo set mdi g10 l10 p0 z1.2 + echo "set mdi g10 l10 p0 z1.2" introspect 104 # Apply the TLO of the special H0. @@ -284,7 +284,7 @@ fi # table, this is an error and the active TLO remains unchanged (so it # stays as the TLO of T7 that we just set above). If T0 is defined, we # apply its TLO here. - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 105 @@ -294,12 +294,12 @@ fi # Try to change TLO of the normal tool T7. This should work on all # configs, but not change the active TLO. - echo set mdi g10 l1 p7 z1.3 + echo "set mdi g10 l1 p7 z1.3" introspect 106 # Apply the TLO of T7, which we just tried to set. This should work on # all configs. - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 107 # Try to change TLO of the strange tool T0. @@ -309,7 +309,7 @@ fi # It should fail on random without T0 because it has no T0. # # It should fail on random with T0 because you cannot change T0. - echo set mdi g10 l1 p0 z1.4 + echo "set mdi g10 l1 p0 z1.4" introspect 108 # Apply the TLO of the special H0. @@ -321,7 +321,7 @@ fi # from T7 above. # # It should work on random with T0 and give us the TLO of T0 (0.0). - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 109 @@ -331,12 +331,12 @@ fi # Try to change TLO of the normal tool T7. This should work on all # configs. - echo set mdi g10 l10 p7 z1.5 + echo "set mdi g10 l10 p7 z1.5" introspect 110 # Apply the TLO of T7, which we just tried to set. This should work on # all configs. - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 111 # Try to change TLO of the strange tool T0. @@ -346,7 +346,7 @@ fi # It should fail on random without T0 because it has no T0. # # It should fail on random with T0 because you cannot change T0 - echo set mdi g10 l10 p0 z1.6 + echo "set mdi g10 l10 p0 z1.6" introspect 112 # Apply the TLO of the special H0. @@ -358,12 +358,12 @@ fi # from T7 above. # # It should work on random with T0 and give us the TLO of T0 (0.0). - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 113 # Try to change TLO of the currently loaded tool, T50. # This should work on all configs but not change the active TLO - echo set mdi g10 l10 p50 z1.7 + echo "set mdi g10 l10 p50 z1.7" introspect 114 # Apply the TLO of the special H0. @@ -375,17 +375,17 @@ fi # from T7 above. # # It should work on random with T0 and give us the TLO of T0 (0.0). - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 115 # Apply the TLO of T7. # This should work on all configs. - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 116 # Apply the TLO of the current tool # This should work on all configs. - echo set mdi g43 + echo "set mdi g43" introspect 117 @@ -405,23 +405,23 @@ fi # -6.0 + 1.7 TLO = -4.3 # # All the configs will be at Z = 6.0 after switching to G59.3. - echo set mdi g10 l20 p9 z6 + echo "set mdi g10 l20 p9 z6" introspect 117.5 - echo set mdi g59.3 + echo "set mdi g59.3" introspect 118 - echo set mdi g54 + echo "set mdi g54" introspect 119 # Try to change TLO of the normal tool T7. This should work on all # configs. - echo set mdi g10 l11 p7 z1.8 + echo "set mdi g10 l11 p7 z1.8" introspect 120 # Apply the TLO of T7, which we just tried to set. This should # work on all configs. - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 121 # Try to change TLO of the strange tool T0. @@ -431,7 +431,7 @@ fi # It should fail on random without T0 because it has no T0. # # This should fail on random with T0 because you cannot change T0. - echo set mdi g10 l11 p0 z1.3 + echo "set mdi g10 l11 p0 z1.3" introspect 122 # Apply the TLO of T0, which we just tried to set. @@ -443,7 +443,7 @@ fi # above. # # It should work on random with T0 and give us the TLO of T0: 0.0 - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 123 @@ -461,7 +461,7 @@ fi # # On random with T0 this should work and put T0 in the spindle. - echo set mdi t0 m6 + echo "set mdi t0 m6" introspect 200 @@ -477,17 +477,17 @@ fi # set above. # # On random with T0 the spindle has tool T0, which has a 0 TLO. - echo set mdi g43 + echo "set mdi g43" introspect 201 # change the TLO of the normal tool T7 # this should work on all configs, but not change the active TLO - echo set mdi g10 l10 p7 z2.0 + echo "set mdi g10 l10 p7 z2.0" introspect 202 # apply the TLO of the normal tool T7 (TLO set above) # this should work on all configs - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 203 # try to change the TLO of T0 @@ -497,7 +497,7 @@ fi # On random without T0 this should fail because there is no T0. # # On random with T0 this should fail because you can't change T0. - echo set mdi g10 l10 p0 z2.1 + echo "set mdi g10 l10 p0 z2.1" introspect 204 # try to apply the TLO of H0 @@ -510,7 +510,7 @@ fi # unchanged. # # On random with T0 this should apply the TLO of T0 (0.0). - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 205 @@ -520,12 +520,12 @@ fi # Try to change TLO of the normal tool T7. This should work on all # configs, but not change the active TLO. - echo set mdi g10 l1 p7 z2.2 + echo "set mdi g10 l1 p7 z2.2" introspect 206 # Apply the TLO of T7, which we just tried to set. This should work on # all configs. - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 207 # Try to change TLO of the strange tool T0. @@ -535,7 +535,7 @@ fi # It should fail on random without T0 because it has no T0. # # This should fail on random with T0 because you cannot change T0. - echo set mdi g10 l1 p0 z2.3 + echo "set mdi g10 l1 p0 z2.3" introspect 208 # Apply the TLO of H0. @@ -547,7 +547,7 @@ fi # from T7 above. # # It should work on random with TLO and give us the TLO of T0. - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 209 @@ -557,12 +557,12 @@ fi # Try to change TLO of the normal tool T7. This should work on all # configs. - echo set mdi g10 l10 p7 z2.4 + echo "set mdi g10 l10 p7 z2.4" introspect 210 # Apply the TLO of T7, which we just tried to set. This should work on # all configs. - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 211 # Try to change TLO of the strange tool T0. @@ -572,7 +572,7 @@ fi # It should fail on random without T0 because it has no T0. # # It should fail on random with T0 because you cannot change T0 - echo set mdi g10 l10 p0 z2.5 + echo "set mdi g10 l10 p0 z2.5" introspect 212 # Apply the TLO of the special H0. @@ -584,7 +584,7 @@ fi # from T7 above. # # It should work on random with T0 and give us the TLO of T0 (0.0). - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 213 @@ -609,13 +609,13 @@ fi # random with T0: -7.0 + 0.0 TLO = -7.0 # # All the configs will be at Z=7.0 after switching to G59.3. - echo set mdi g10 l20 p9 z7 + echo "set mdi g10 l20 p9 z7" introspect 213.5 - echo set mdi g59.3 + echo "set mdi g59.3" introspect 214 - echo set mdi g54 + echo "set mdi g54" introspect 215 # Try to change TLO of the normal tool T7. This should work on all @@ -627,12 +627,12 @@ fi # Random with T0: -7.0 + 2.6 = -4.4 # # But these offsets are not active until the G43 below. - echo set mdi g10 l11 p7 z2.6 + echo "set mdi g10 l11 p7 z2.6" introspect 216 # Apply the TLO of T7, which we just tried to set. This should # work on all configs. - echo set mdi g43 h7 + echo "set mdi g43 h7" introspect 217 # Try to change TLO of the strange tool T0. @@ -642,7 +642,7 @@ fi # It should fail on random without T0 because it has no T0. # # It should work on random with T0 because you cannot change T0. - echo set mdi g10 l11 p0 z2.7 + echo "set mdi g10 l11 p0 z2.7" introspect 218 # Apply the TLO of H0. @@ -655,7 +655,7 @@ fi # # It should work on random with T0 and give us a TLO of the tool in the # spindle, T0 - echo set mdi g43 h0 + echo "set mdi g43 h0" introspect 219 diff --git a/tests/t0/subs/M100 b/tests/t0/subs/M100 index b32c2433438..d64a15ab176 100755 --- a/tests/t0/subs/M100 +++ b/tests/t0/subs/M100 @@ -15,15 +15,15 @@ Q=$2 #echo Q is $Q >> $OUT_FILE case $P in - 0.000000) echo "X = $Q" >> $OUT_FILE;; - 1.000000) echo "Y = $Q" >> $OUT_FILE;; - 2.000000) echo "Z = $Q" >> $OUT_FILE;; - 3.000000) echo "toolno = $Q" >> $OUT_FILE;; - 4.000000) echo "tlo_z = $Q" >> $OUT_FILE;; - 5.000000) echo "" >> $OUT_FILE;; - 6.000000) echo "sequence number $Q" >> $OUT_FILE;; + 0.000000) echo "X = $Q" >> "$OUT_FILE" ;; + 1.000000) echo "Y = $Q" >> "$OUT_FILE" ;; + 2.000000) echo "Z = $Q" >> "$OUT_FILE" ;; + 3.000000) echo "toolno = $Q" >> "$OUT_FILE" ;; + 4.000000) echo "tlo_z = $Q" >> "$OUT_FILE" ;; + 5.000000) echo "" >> "$OUT_FILE" ;; + 6.000000) echo "sequence number $Q" >> "$OUT_FILE" ;; *) - echo "unknown P=$P (Q=$Q)" >> $OUT_FILE + echo "unknown P=$P (Q=$Q)" >> "$OUT_FILE" exit 1;; esac diff --git a/tests/toolchanger/subs/M100 b/tests/toolchanger/subs/M100 index b32c2433438..d64a15ab176 100755 --- a/tests/toolchanger/subs/M100 +++ b/tests/toolchanger/subs/M100 @@ -15,15 +15,15 @@ Q=$2 #echo Q is $Q >> $OUT_FILE case $P in - 0.000000) echo "X = $Q" >> $OUT_FILE;; - 1.000000) echo "Y = $Q" >> $OUT_FILE;; - 2.000000) echo "Z = $Q" >> $OUT_FILE;; - 3.000000) echo "toolno = $Q" >> $OUT_FILE;; - 4.000000) echo "tlo_z = $Q" >> $OUT_FILE;; - 5.000000) echo "" >> $OUT_FILE;; - 6.000000) echo "sequence number $Q" >> $OUT_FILE;; + 0.000000) echo "X = $Q" >> "$OUT_FILE" ;; + 1.000000) echo "Y = $Q" >> "$OUT_FILE" ;; + 2.000000) echo "Z = $Q" >> "$OUT_FILE" ;; + 3.000000) echo "toolno = $Q" >> "$OUT_FILE" ;; + 4.000000) echo "tlo_z = $Q" >> "$OUT_FILE" ;; + 5.000000) echo "" >> "$OUT_FILE" ;; + 6.000000) echo "sequence number $Q" >> "$OUT_FILE" ;; *) - echo "unknown P=$P (Q=$Q)" >> $OUT_FILE + echo "unknown P=$P (Q=$Q)" >> "$OUT_FILE" exit 1;; esac diff --git a/tests/toolchanger/toolno-pocket-differ/shared-test.sh b/tests/toolchanger/toolno-pocket-differ/shared-test.sh index 34426e36e4c..e0533206ae3 100755 --- a/tests/toolchanger/toolno-pocket-differ/shared-test.sh +++ b/tests/toolchanger/toolno-pocket-differ/shared-test.sh @@ -10,7 +10,7 @@ cp ../../simpockets.tbl.original simpockets.tbl rm -f gcode-output if nc -z localhost 5007; then - echo "Process already listening on port 5007. Exiting" + echo "E: Process already listening on port 5007. Exiting" exit 1 fi @@ -20,15 +20,15 @@ linuxcnc -r sim.ini & # let linuxcnc come up TOGO=80 while [ $TOGO -gt 0 ]; do - echo trying to connect to linuxcncrsh TOGO=$TOGO + echo "I: trying to connect to linuxcncrsh TOGO=$TOGO" if nc -z localhost 5007; then break fi sleep 0.25 - TOGO=$(($TOGO - 1)) + TOGO=$((TOGO - 1)) done if [ $TOGO -eq 0 ]; then - echo connection to linuxcncrsh timed out + echo "I: connection to linuxcncrsh timed out" exit 1 fi @@ -37,123 +37,123 @@ fi function introspect() { SEQUENCE_NUMBER=$1 echo "set mdi m100 P6 Q$SEQUENCE_NUMBER" # sequence number - echo 'set mdi m100 P0 Q#5420' # X - echo 'set mdi m100 P1 Q#5421' # Y - echo 'set mdi m100 P2 Q#5422' # Z - echo 'set mdi m100 P3 Q#5400' # toolno - echo 'set mdi m100 P4 Q#5403' # TLO z - echo 'set mdi m100 P5' # blank line + echo "set mdi m100 P0 Q#5420" # X + echo "set mdi m100 P1 Q#5421" # Y + echo "set mdi m100 P2 Q#5422" # Z + echo "set mdi m100 P3 Q#5400" # toolno + echo "set mdi m100 P4 Q#5403" # TLO z + echo "set mdi m100 P5" # blank line } - echo hello EMC mt 1.0 - echo set enable EMCTOO + echo "hello EMC mt 1.0" + echo "set enable EMCTOO" - echo set estop off - echo set machine on - echo set mode mdi + echo "set estop off" + echo "set machine on" + echo "set mode mdi" introspect 0 - echo set mdi t1 m6 + echo "set mdi t1 m6" introspect 1 - echo set mdi g43 + echo "set mdi g43" introspect 2 - echo set mdi g10 l10 p1 z.1 + echo "set mdi g10 l10 p1 z.1" introspect 3 - echo set mdi g43 + echo "set mdi g43" introspect 4 - echo set mdi g10 l10 p10 z.15 + echo "set mdi g10 l10 p10 z.15" introspect 5 - echo set mdi g43 + echo "set mdi g43" introspect 6 - echo set mdi g10 l10 p99999 z.2 + echo "set mdi g10 l10 p99999 z.2" introspect 7 - echo set mdi g43 + echo "set mdi g43" introspect 8 - echo set mdi t10 m6 + echo "set mdi t10 m6" introspect 9 - echo set mdi g43 + echo "set mdi g43" introspect 10 - echo set mdi g10 l10 p1 z.103 + echo "set mdi g10 l10 p1 z.103" introspect 11 - echo set mdi g43 + echo "set mdi g43" introspect 12 - echo set mdi g10 l10 p10 z.1035 + echo "set mdi g10 l10 p10 z.1035" introspect 13 - echo set mdi g43 + echo "set mdi g43" introspect 14 - echo set mdi g10 l10 p99999 z.104 + echo "set mdi g10 l10 p99999 z.104" introspect 15 - echo set mdi g43 + echo "set mdi g43" introspect 16 - echo set mdi t99999 m6 + echo "set mdi t99999 m6" introspect 17 - echo set mdi g43 + echo "set mdi g43" introspect 18 - echo set mdi g10 l10 p1 z.3 + echo "set mdi g10 l10 p1 z.3" introspect 19 - echo set mdi g43 + echo "set mdi g43" introspect 20 - echo set mdi g10 l10 p10 z.35 + echo "set mdi g10 l10 p10 z.35" introspect 21 - echo set mdi g43 + echo "set mdi g43" introspect 22 - echo set mdi g10 l10 p99999 z.4 + echo "set mdi g10 l10 p99999 z.4" introspect 23 - echo set mdi g43 + echo "set mdi g43" introspect 24 - echo set mdi t1 m6 + echo "set mdi t1 m6" introspect 25 - echo set mdi g43 + echo "set mdi g43" introspect 26 - echo set mdi t10 m6 + echo "set mdi t10 m6" introspect 27 - echo set mdi g43 + echo "set mdi g43" introspect 28 - echo set mdi t99999 m6 + echo "set mdi t99999 m6" introspect 29 - echo set mdi g43 + echo "set mdi g43" introspect 30 # wait for linuxcnc to finish - echo set wait done + echo "set wait done" - echo shutdown + echo "shutdown" ) | nc localhost 5007 diff --git a/tests/trajectory-planner/circular-arcs/test-lengths.sh b/tests/trajectory-planner/circular-arcs/test-lengths.sh index 893f1e01baa..7611afd25d8 100755 --- a/tests/trajectory-planner/circular-arcs/test-lengths.sh +++ b/tests/trajectory-planner/circular-arcs/test-lengths.sh @@ -2,8 +2,8 @@ set -o monitor ./build-debug.sh cp position.blank position.txt -linuxcnc $1 > test.log & -./machine_setup.py $2 +linuxcnc "$1" > test.log & +./machine_setup.py "$2" fg ./save_lengths.sh test.log #if [ -a length_data.log ] diff --git a/tests/trajectory-planner/circular-arcs/util/save_vel.sh b/tests/trajectory-planner/circular-arcs/util/save_vel.sh index 16d43718ee5..c0fc792c545 100755 --- a/tests/trajectory-planner/circular-arcs/util/save_vel.sh +++ b/tests/trajectory-planner/circular-arcs/util/save_vel.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o nounset # Treat unset variables as an error -if [ -a $1 ] +if [ -a "$1" ] then - awk '/tc state/ {print $5,$8,$11}' $1 > vel_data.log + awk '/tc state/ {print $5,$8,$11}' "$1" > vel_data.log fi