K
K
ksvdon2014-12-15 14:40:01
linux
ksvdon, 2014-12-15 14:40:01

Why doesn't it go to background?

If you write something like
md5sum /dev/urandom &
it will immediately go to the background, but if you run the same command on a remote host

expect -c 'spawn ssh -o StrictHostKeyChecking=no -o UserKnowHostFile=/dev/null [email protected] "md5sum /dev/urandom &" expect password; send "12345\n"; interact'

then it will hang, they say, it is being executed ... As if I did not drive it into the background ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konkase, 2014-12-15
@ksvdon

/usr/bin/expect -c '
  spawn ssh -oStrictHostKeyChecking=no [email protected]
  expect "word:"
  send "password\r"
  expect ".*"
  send "md5sum /dev/urandom \&\r"
  expect ".*"
  interact'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question