]> Sergey Matveev's repositories - btrtrc.git/commitdiff
shellcheck
authorMatt Joiner <anacrolix@gmail.com>
Sun, 18 Feb 2024 04:20:26 +0000 (15:20 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 22 Feb 2024 03:29:24 +0000 (14:29 +1100)
fs/test.sh

index 5374ed86b6a89a615c9e6a5fb109223400c6e5a8..7ac309a8bd083fc102ea49e4c21347aefee26b28 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-echo $BASH_VERSION
+echo BASH_VERSION="$BASH_VERSION"
 set -eux
 repopath="$(cd "$(dirname "$0")/.."; pwd)"
 debian_file=debian-10.8.0-amd64-netinst.iso
@@ -15,7 +15,7 @@ file=Sintel/Sintel.mp4
 
 GOPPROF=http godo -v -- "$repopath/fs/cmd/torrentfs" -mountDir=mnt -metainfoDir=torrents &
 torrentfs_pid=$!
-trap "kill $torrentfs_pid" EXIT
+trap 'kill "$torrentfs_pid"' EXIT
 
 check_file() {
        while [ ! -e "mnt/$file" ]; do sleep 1; done
@@ -28,7 +28,7 @@ check_file() {
 ( check_file ) &
 check_file_pid=$!
 
-trap "kill $torrentfs_pid $check_file_pid" EXIT
+trap 'kill "$torrentfs_pid" "$check_file_pid"' EXIT
 wait -n
 status=$?
 sudo umount mnt