Skip to content

anyway to pass multiple arguments in a single bugy parameter? (i have a work around) #669

Open
@bob454522

Description

@bob454522

bugy v1.18 (and 1.17)-

Im trying to create a simple interface for a end user where a single parameter (type=text field) in bugy calls a bash script, that needs 4x arguments, ie i want bugy to execute exactly:
./myscript.sh arg1 arg2 arg3 arg4
(when my single type=Text Parameter contains exactly: arg1 arg2 arg3 arg4

In bugy, If i make a Parameter of Text or multi-Line text, and input exactly;

arg1 arg2 arg3 arg4
what gets executed is (note the single quotes):

./myscript.sh 'arg1 arg2 arg3 arg4'

(thus arg $1 = 'arg1 arg2 arg3 arg4' and arg$2 is blank/null.)

(FWIW- its a bit confusing that the bugy python scrolling log doesnt show this, as it shows: exactly what im looking for (ie it does not show the single quotes):
2023-05-04 12:22:19,307 [script_server.execution_service.INFO] Calling script #6: /home/myScript.sh arg1 arg2 arg3 arg4

(im hoping there is a solution or that im doing something wrong, i realize i could have 4x parameters, one each for arg1 arg2 arg3...

for now a workaround, that works, is the EXCELLENT feature bugy offers of: "Pass as stdin" with Stdin expected Text.

so what i do is - have the script echo the expected text, then read in bugys output (ie arg1 arg2 arg3 arg4) , then in the script i run the real script directly:
./RealScript.sh $readINvar

(without double quotes on readINvar, which gets me the correct execution with 4x args).

Im curious if im doing something wrong, or if there is a way to have 1x bugy parameter execute exactly what the user inputs (ie including spaces, and not adding single quotes around what is finally executed).

(if im not explaining this clearly, please see image below with the bash script behind it.)

thanks
(and WOW is bugy excellent software!! thank you devs for your time and hard work on it!)

image example:

image

(and bash script behind this is:

image

`#!/bin/bash

location=$(echo "$1" | tr -cd [:alnum:])
unit=$(echo "$2" | tr -cd [:digit:])
apMac=$(echo "$3" | tr -cd [:alnum:]: | tr [:lower:] [:upper:])

echo "location: $location ( ssh ip: $sship )"
echo "unit: $unit "
echo "newAP MAC: $apMac "`

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions