diff options
author | a1346054 | 2021-08-31 17:01:47 +0000 |
---|---|---|
committer | rfjakob | 2021-09-01 10:22:01 +0200 |
commit | c63f7e9f64ee394b3311edb7f36f56fd786d145a (patch) | |
tree | 84dec7ad0b4759532f622174c008e3aa645c5a29 /profiling | |
parent | c505e73a13d8e2083b53c5c1af1f937b46665abd (diff) |
shell scripts: fix shellcheck warnings
Diffstat (limited to 'profiling')
-rwxr-xr-x | profiling/ls.bash | 18 | ||||
-rwxr-xr-x | profiling/streaming-read.bash | 16 | ||||
-rwxr-xr-x | profiling/streaming-write.bash | 10 | ||||
-rwxr-xr-x | profiling/tar-extract.bash | 10 | ||||
-rwxr-xr-x | profiling/write-trace.bash | 10 |
5 files changed, 32 insertions, 32 deletions
diff --git a/profiling/ls.bash b/profiling/ls.bash index 5f736b6..d8d55f6 100755 --- a/profiling/ls.bash +++ b/profiling/ls.bash @@ -6,10 +6,10 @@ cd "$(dirname "$0")" ../tests/dl-linux-tarball.bash T=$(mktemp -d) -mkdir $T/a $T/b +mkdir "$T/a" "$T/b" -../gocryptfs -init -quiet -scryptn 10 -extpass "echo test" $T/a -../gocryptfs -quiet -nosyslog -extpass "echo test" $T/a $T/b +../gocryptfs -init -quiet -scryptn 10 -extpass "echo test" "$T/a" +../gocryptfs -quiet -nosyslog -extpass "echo test" "$T/a" "$T/b" # Cleanup trap trap "cd /; fusermount -u -z $T/b; rm -Rf $T/a" EXIT @@ -17,20 +17,20 @@ trap "cd /; fusermount -u -z $T/b; rm -Rf $T/a" EXIT echo "Creating 40000 empty files (linux-3.0.tar.gz contains 36782 files)..." SECONDS=0 for dir in $(seq -w 1 200); do - mkdir $T/b/$dir - ( cd $T/b/$dir ; touch $(seq -w 1 200) ) + mkdir "$T/b/$dir" + ( cd "$T/b/$dir" ; touch $(seq -w 1 200) ) done echo "done, $SECONDS seconds" echo "Remount..." -fusermount -u $T/b -../gocryptfs -quiet -nosyslog -extpass "echo test" -cpuprofile $T/cprof -memprofile $T/mprof \ - $T/a $T/b +fusermount -u "$T/b" +../gocryptfs -quiet -nosyslog -extpass "echo test" -cpuprofile "$T/cprof" -memprofile "$T/mprof" \ + "$T/a" "$T/b" echo "Running ls under profiler (3x)..." for i in 1 2 3; do SECONDS=0 -ls -lR $T/b > /dev/null +ls -lR "$T/b" > /dev/null echo "$i done, $SECONDS seconds" done diff --git a/profiling/streaming-read.bash b/profiling/streaming-read.bash index df75c68..ef55138 100755 --- a/profiling/streaming-read.bash +++ b/profiling/streaming-read.bash @@ -3,25 +3,25 @@ cd "$(dirname "$0")" T=$(mktemp -d) -mkdir $T/a $T/b +mkdir "$T/a" "$T/b" -../gocryptfs -init -quiet -scryptn 10 -extpass "echo test" $T/a -../gocryptfs -quiet -extpass "echo test" $T/a $T/b +../gocryptfs -init -quiet -scryptn 10 -extpass "echo test" "$T/a" +../gocryptfs -quiet -extpass "echo test" "$T/a" "$T/b" # Cleanup trap trap "cd /; fusermount -u -z $T/b; rm -Rf $T/a" EXIT # Write 100MB test file -dd if=/dev/zero of=$T/b/zero bs=1M count=100 status=none +dd if=/dev/zero of="$T/b/zero" bs=1M count=100 status=none # Remount with profiling -fusermount -u $T/b -../gocryptfs -quiet -extpass "echo test" -cpuprofile $T/cprof -memprofile $T/mprof \ - $T/a $T/b +fusermount -u "$T/b" +../gocryptfs -quiet -extpass "echo test" -cpuprofile "$T/cprof" -memprofile "$T/mprof" \ + "$T/a" "$T/b" # Read 10 x 100MB instead of 1 x 1GB to keep the used disk space low for i in $(seq 1 10); do - dd if=$T/b/zero of=/dev/null bs=1M count=100 + dd if="$T/b/zero" of=/dev/null bs=1M count=100 done echo diff --git a/profiling/streaming-write.bash b/profiling/streaming-write.bash index 7732cfb..2cd74ad 100755 --- a/profiling/streaming-write.bash +++ b/profiling/streaming-write.bash @@ -3,18 +3,18 @@ cd "$(dirname "$0")" T=$(mktemp -d) -mkdir $T/a $T/b +mkdir "$T/a" "$T/b" -../gocryptfs -init -quiet -scryptn 10 -extpass "echo test" $T/a -../gocryptfs -quiet -extpass "echo test" -cpuprofile $T/cprof -memprofile $T/mprof \ - $T/a $T/b +../gocryptfs -init -quiet -scryptn 10 -extpass "echo test" "$T/a" +../gocryptfs -quiet -extpass "echo test" -cpuprofile "$T/cprof" -memprofile "$T/mprof" \ + "$T/a" "$T/b" # Cleanup trap trap "cd /; fusermount -u -z $T/b; rm -Rf $T/a" EXIT # Write 10 x 100MB instead of 1 x 1GB to keep the used disk space low for i in $(seq 1 10); do - dd if=/dev/zero of=$T/b/zero bs=1M count=100 + dd if=/dev/zero of="$T/b/zero" bs=1M count=100 done echo diff --git a/profiling/tar-extract.bash b/profiling/tar-extract.bash index 21b2e2b..25f99a6 100755 --- a/profiling/tar-extract.bash +++ b/profiling/tar-extract.bash @@ -6,17 +6,17 @@ cd "$(dirname "$0")" ../tests/dl-linux-tarball.bash T=$(mktemp -d) -mkdir $T/a $T/b +mkdir "$T/a" "$T/b" -../gocryptfs -init -quiet -scryptn 10 -extpass "echo test" $T/a -../gocryptfs -quiet -extpass "echo test" -cpuprofile $T/cprof -memprofile $T/mprof \ - $T/a $T/b +../gocryptfs -init -quiet -scryptn 10 -extpass "echo test" "$T/a" +../gocryptfs -quiet -extpass "echo test" -cpuprofile "$T/cprof" -memprofile "$T/mprof" \ + "$T/a" "$T/b" # Cleanup trap trap "cd /; fusermount -u -z $T/b; rm -Rf $T/a" EXIT echo "Extracting..." -time tar xzf /tmp/linux-3.0.tar.gz -C $T/b +time tar xzf /tmp/linux-3.0.tar.gz -C "$T/b" echo echo "Hint: go tool pprof ../gocryptfs $T/cprof" diff --git a/profiling/write-trace.bash b/profiling/write-trace.bash index 3475140..bb1de1a 100755 --- a/profiling/write-trace.bash +++ b/profiling/write-trace.bash @@ -6,17 +6,17 @@ cd "$(dirname "$0")" T=$(mktemp -d) -mkdir $T/a $T/b +mkdir "$T/a" "$T/b" -../gocryptfs -init -quiet -scryptn 10 -extpass "echo test" $T/a -../gocryptfs -quiet -extpass "echo test" -trace $T/trace \ - $T/a $T/b +../gocryptfs -init -quiet -scryptn 10 -extpass "echo test" "$T/a" +../gocryptfs -quiet -extpass "echo test" -trace "$T/trace" \ + "$T/a" "$T/b" # Cleanup trap trap "cd /; fusermount -u -z $T/b; rm -Rf $T/a" EXIT # Write only 1x100MB, otherwise the trace gets too big. -dd if=/dev/zero of=$T/b/zero bs=1M count=100 +dd if=/dev/zero of="$T/b/zero" bs=1M count=100 echo echo "Hint: go tool trace $T/trace" |