spawn

Using an expect Script to send the output of a command and store in a file

筅森魡賤 提交于 2019-12-11 11:14:05
问题 Hi I am trying to store the output of a command run through a spawn ssh remote window into my local host, I am new to expect and am not able to figure out where I am wrong. My Code: #!/bin/bash while read line do /usr/bin/expect <<EOD spawn ssh mininet@$line expect "assword:" send -- "mininet\r" set output [open "outputfile.txt" "a+"] expect "mininet@mininet-vm:*" send -- "ls\r" set outcome $expect_out(buffer) send "\r" puts $output "$outcome" close $output expect "mininet@mininet-vm:*" send

Spawning a .lnk windows shortcut with node.js gives “UNKNOWN” error

房东的猫 提交于 2019-12-11 08:18:02
问题 I'm having a game spawned as a child process. It all works nice and well with the game's original .exe file. However, I'd like it to execute minimized, and the only way to do it as far as I can tell is to create a windows shortcut (.lnk file, in the same directory) and set the launch options to minimized. Node.js doesn't like that: internal/child_process.js:313 throw errnoException(err, 'spawn'); ^ Error: spawn UNKNOWN at exports._errnoException (util.js:1026:11) at ChildProcess.spawn

Receiving data in slaves mpi spawn c

∥☆過路亽.° 提交于 2019-12-11 07:24:37
问题 I'm trying to implement the following scenario using mpi_comm_spawn & scatter : 1- Master spawns 2 processes with a job. 2- He scatters an array to those spawned processes. 3- The spawned processes receive the scattered array sort it then send it back. 4- The master receives the sorted parts of the array. I'd like to know how to do the step 2, so far i've tried with send and receives, they work perfectly but i want to do it with the scatter function. Edit : Here's what i'd like to do in the

Streaming response from child_process.spawn curl request

随声附和 提交于 2019-12-11 04:15:32
问题 I'm trying to run the cURL command to install RVM and ruby via child_process.spawn , but it always errors out: let spawnProcess = spawn('\curl -sSL https://get.rvm.io | bash -s stable --ruby') spawnProcess.stdout.on('data', data => { console.log('DATA RECEIVED') console.log(data) }) spawnProcess.stdout.on('close', () => { alert('done!') }) spawnProcess.stderr.on('data', function(){ console.log('ON DATA') console.log(arguments) }) spawnProcess.on('error', error => { console.log('ON ERROR')

could not able to spawn(ssh) using expect

混江龙づ霸主 提交于 2019-12-11 04:03:18
问题 while executing $expect filename.exp user pwd ip I got the error could not execute "ssh -l user ip": no such file or directory The contents of filename.exp are this: #!/opt/sfw/bin/expect -D set OMC_Usr [lindex $argv 0] set OMC_Pwd [lindex $argv 1] set OMC_IP [lindex $argv 2] set cmd "ssh -l $OMC_Usr $OMC_IP" spawn $cmd expect "Password:" send "$OMC_Pwd\r" interact help me to proceed Thanks... 回答1: The problem is that spawn needs the command and its arguments passed to it as multiple Tcl

Can a spawned process communicate with the “main” MPI communicator

久未见 提交于 2019-12-11 02:36:09
问题 Is there a way using MPI to let spawned processes communicate with all other actors in the MPI_WORLD and not only with the parent that spawned the process? Now I have two main agents, the so-called master and slave that run the following code (spawn.py): # Spawn test: master and first slave import sys from mpi4py import MPI comm = MPI.COMM_WORLD rank = comm.Get_rank() if rank == 0 : # master code print "i am the master on rank %i" % (rank) running = True while running : msg = comm.recv(source

unable to spawn git no such file or directory on a specific fork on github

南笙酒味 提交于 2019-12-11 02:09:01
问题 The problem is with this fork/repo : https://github.com/RubenWillems/CCNet I can get other forks on the same laptop, but not this one. trying with ssh gives the same problem. I'm suspecting a security setup issue with the fork, but I have no idea. Any idea on how to (start) tackling this, I am quite new to git. 回答1: This http://devnet.jetbrains.net/message/5321236#5321236 workaround from JetBrains works for me perfectly. Here are commands when JetBrains forum thread would not available

shell command to child_process.spawn(command, [args], [options]) node.js

荒凉一梦 提交于 2019-12-10 23:59:38
问题 Basically, I just want to run rsync command on node app. The raw rsync code is the below: rsync -r -t -p -o -g -v --progress --delete -l -H /Users/ken/Library/Application Support/Sublime Text 3/Packages /Users/ken/Google Drive/__config-GD/ST3 Firstly, I tried child_process.exec(command, [options], callback) but, since the rsync output is long, the buffer exceeded. So, I tried child_process.spawn(command, [args], [options]) instead, and stream.pipe out. var spawn = require('child_process')

Node-webkit child spawn UNKNOWN error

自古美人都是妖i 提交于 2019-12-10 14:39:10
问题 I'm trying to launch an .exe elsewhere on my Windows filesystem. spawn = require('child_process').spawn; game.process = spawn(path.join(config.values.armaPath, 'arma3.exe'), { detached: true }); I've wrapped it in a try/catch and the error I'm getting isn't helpful: Error {code: "UNKNOWN", errno: "UNKNOWN", syscall: "spawn", stack: (...), message: "spawn UNKNOWN"}code: "UNKNOWN"errno: "UNKNOWN"message: "spawn UNKNOWN" I've confirmed that the path.join to the .exe is correct. I've also tried

How to Spawn Child Processes that Don't Die with Parent?

落花浮王杯 提交于 2019-12-10 14:14:59
问题 I have a C++ program that acts as a watchdog over others. If it detects that a process is no longer running, it restarts it via system . The problem is, if I kill the watchdog process, any processes it has started up also die. void* ProcessWatchdog::worker(void* arg) { //Check if process is running if( !processRunning ) system("processName /path/to/processConfig.xml &"); } The new child process gets started correctly, and runs without any problems. But when the parent (now this