Skip to content

asynchronous exec #34

@joques

Description

@joques

Hi,
I am trying to use the exec function in an asynchronous code as follows


shell = require 'shelljs'
shell.exec('ssh -l username host \"cd Desktop; touch example.txt\"', (code, output) ->
console.log code
)

Although the command is executed successfully, it doesn't print the code. So I have no way in my code to know what happened to the ssh command. Is there a different way of calling exec asynchronously?
Note that the synchronous case works perfectly
Thanks
José

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions