From 7367ee42528772501f2aa3f756cc99f191155348 Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 14 Feb 2023 08:51:49 +0000 Subject: [PATCH] fix(unitproc/bkt-randFloat):Resolve shellcheck delinter warnings --- unitproc/bkt-randFloat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unitproc/bkt-randFloat b/unitproc/bkt-randFloat index 077e8d0..7d61707 100644 --- a/unitproc/bkt-randFloat +++ b/unitproc/bkt-randFloat @@ -6,7 +6,7 @@ randFloat() { # Usage: randFloat arg1 # Inputs: arg1: number of decimal places # Output: stdout: float as decimal string - # Version: 0.1.0 + # Version: 0.1.1 # Note: Outputs float from 0.000... to 0.999... # Note: Default number of decimals is 5. # Ref/Attrib: Integer test regular expression https://stackoverflow.com/a/806923 @@ -21,11 +21,11 @@ randFloat() { echo "ERROR:Not an integer." >&2; exit 1; fi; else - echo "ERROR:Invalid number of arguments:${@}"; + echo "ERROR:Invalid number of arguments:${*}"; fi; # Produce output - decimals="$(head -c ${arg1:-5} < <(LC_ALL=C tr -cd "[:digit:]" < <(cat /dev/urandom)))"; + decimals="$(head -c "${arg1:-5}" < <(LC_ALL=C tr -cd "[:digit:]" < <(cat /dev/urandom)))"; printf "0.%s\n" "$decimals"; }; # output random float [0.00000 1.00000] to stdout #==END Function Definitions== -- 2.30.2