0
텔넷을 통해 테스트중인 장치에 액세스하는 동시에 테스트의 다른 부분을 자동화하는 셸 스크립트를 실행하는 테스트 스크립트를 작성하려고합니다. 자동화 부분이 완료되었지만 테스트가 실행될 때 텔넷 연결을 제대로 열고 데이터를 저장하지 못하는 문제가 있습니다. 내가 위를 실행하면 아래 셸 스크립트를 동시에 실행하면서 텔넷 연결을 끊는 중
내 테스트 쉘 스크립트와 그것이 내가이 오류를 얻고있다#! /bin/bash
declare -r telnetip=1.1.1.2
declare -r username=root
declare -r filename=telnettest.txt
declare -r runTime=10
./telnet.exp $telnetip $username $filename $runTime #telnet script
./tot.sh #automation script
#! /usr/bin/expect -f
set base_dir [lindex $argv 0]
set user [lindex $argv 1]
set filename [lindex $argv 2]
set delay [lindex $argv 3]
spawn telnet
expect "telnet> "
send "open $base_dir\r"
expect "Trying 1.1.1.2..."
expect "Connected to 1.1.1.2"
expect "Escape character is '^]'. "
expect "soc1 login:"
send "$user\r"
sleep 2
expect "*$*"
send "<data access command>\r" > $filename
sleep delay+5
를 참조하는 것을 기대하는 스크립트입니다
usage: send [args] string
while executing
"send "<data access command>\r" > $filename"
(file "./telnet.exp" line 18)
내 유닉스에 대한 마지막 침략은 14 년 전이었고, 그래서 나는 틀린 일을하고 있다고 확신한다.
telnet.exp를 실행하는 동안 동시에 실행하려는 추가 스크립트가 예제 셸 스크립트에서 삭제되었습니다. 바로 후에 호출됩니다. 나는 이것을 반영하기 위해 원래의 글을 편집했다. – caylorman