Bash needs to send a command to another CLI
0
votes
2
answers
2242
views
I want to automate some command the thing is we login to the server and the next commandline isn't a linux commandline but rather that of an application it self. My current attempt of solution is the following.
#!/bin/bash
# smsme.sh
i=0
i=$((i+1))
rancli
sleep 3
echo
add saf dest=4949 orig=Wim text=$i
sleep 120;
# ---
Quick hint it breaks on add. I tried piping the commands as well it just echoed in the linux enverimont without ever hitting the rancli
Updated scripts after update
#!/bin/bash
# smsme.sh
i=0
i=$((i+1))
rancli
read $reply
Answer script
#!/usr/bin/env expect
set timeout -1
spawn ./smsme.sh
expect {
"Quortus Core CLI (c) 2019
No entry for terminal type "xterm-256color";
using dumb terminal settings.
Connecting to RAN at 127.0.0.1:3012QCore>
LTE64b>"
}
eof
}
send -- add saf dest=4949 orig=Wim text=wim
expect "Submitted, message number $1"
expect eof
Asked by Joeri_Damian
(1 rep)
May 10, 2019, 10:26 AM
Last activity: May 13, 2019, 11:30 AM
Last activity: May 13, 2019, 11:30 AM