Skip to content

Commit

Permalink
regex variable
Browse files Browse the repository at this point in the history
  • Loading branch information
noursaidi committed Jun 7, 2022
1 parent bbfe931 commit 6c7f39a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/pubber
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ if (($# == 0)); then
$ROOT_DIR/pubber/bin/run $project_id $site_path $device_id $serial_no
else
declare -A options
regex_numeric="^\d+([.]\d+)?$"

for option in $*; do
if [[ $option == *"="* ]]; then
k=$(echo $option | cut -d'=' -f1)
v=$(echo $option | cut -d'=' -f2)
if ! [[ $v =~ "^\d+([.]\d+)?$" ]]; then
if ! [[ $v =~ $regex_numeric ]]; then
v="\"$v\""
fi
else
Expand Down

0 comments on commit 6c7f39a

Please sign in to comment.