Petals ESB CLI

Unable to execute system command with arguments

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.1.2
  • Fix Version/s: 2.1.2, 2.2.0
  • Component/s: Command 'system'
  • Security Level: Public
  • Description:

    The following command line does not print the expected result: linux

    cdeneux@cdeneux-laptop:~$ petals-cli -c -- system echo linux
    
    cdeneux@cdeneux-laptop:~$
  • Environment:
    -

Activity

Hide
Christophe DENEUX added a comment - Wed, 7 May 2014 - 11:13:17 +0200 - edited

Workaround with quotes for 2.1.2
In version 2.2.0, quotes are not required:

cdeneux@cdeneux-laptop:~$ petals-cli -c -- system echo linux
linux
cdeneux@cdeneux-laptop:~$ petals-cli -c -- system "echo linux"
linux
Show
Christophe DENEUX added a comment - Wed, 7 May 2014 - 11:13:17 +0200 - edited Workaround with quotes for 2.1.2 In version 2.2.0, quotes are not required:
cdeneux@cdeneux-laptop:~$ petals-cli -c -- system echo linux
linux
cdeneux@cdeneux-laptop:~$ petals-cli -c -- system "echo linux"
linux
Hide
Christophe DENEUX added a comment - Wed, 7 May 2014 - 10:32:57 +0200 - edited

This is due to that the command system accepts only one argument. In the explain case, the argument taken into account by the command is 'echo'. The argument 'linux' is skiped.

A workaround, for version prior to 4.2, is to enclosed the complete system command with quotes: petals-cli -c system "echo linux"

Show
Christophe DENEUX added a comment - Wed, 7 May 2014 - 10:32:57 +0200 - edited This is due to that the command system accepts only one argument. In the explain case, the argument taken into account by the command is 'echo'. The argument 'linux' is skiped. A workaround, for version prior to 4.2, is to enclosed the complete system command with quotes: petals-cli -c system "echo linux"

People

Dates

  • Created:
    Wed, 7 May 2014 - 10:28:56 +0200
    Updated:
    Wed, 7 May 2014 - 11:14:11 +0200
    Resolved:
    Wed, 7 May 2014 - 11:13:17 +0200