Skip to content

upload_and_run doesn't separate $command from first arg #1616

@akarelas

Description

@akarelas

Describe the bug

When doing this:

my $output = upload_and_run <<~'BASH', 'foo';
#!/bin/bash
echo $1
BASH

...this produces an error, because it's trying to execute /tmp/${random_string}.tmpfoo on the server (observe that there's no space separating the command from the first argument).

Expected behavior

$output should equal the string foo

How to reproduce it

Write the code in the bug description inside a task, and see the error being output.

Code example

No response

Additional context

No response

Rex version

1.14.3

Perl version

v5.38.2

Operating system running rex

Void Linux

Operating system managed by rex

Debian

How rex was installed?

package manager

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions