Skip to content

Commit

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

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

0 comments on commit f6ce069

Please sign in to comment.