yhelothar
Lifer
I'm trying to embed an expect script, but the command I'm setting has some major quoteception going on with variables inside of them and I'm having difficulty on getting it all worked out.
MPJLAUNCH=/filepath.sh
nbnodes=25
expect -c '
spawn ssh username@server
expect 'assword' {send $::env(password)\r}
expect '$ '
send 'sed -i "s/-np [0-9][0-9]/-np $nbnodes/g" $MPJLAUNCH\r'
'
When I launch this, I get an error:
send sed" : no such file or directory
So it seems like it's reading " as the file path?
MPJLAUNCH=/filepath.sh
nbnodes=25
expect -c '
spawn ssh username@server
expect 'assword' {send $::env(password)\r}
expect '$ '
send 'sed -i "s/-np [0-9][0-9]/-np $nbnodes/g" $MPJLAUNCH\r'
'
When I launch this, I get an error:
send sed" : no such file or directory
So it seems like it's reading " as the file path?
Last edited: