URL: https://www.opennet.me/cgi-bin/openforum/vsluhboard.cgi
Форум: vsluhforumID9
Нить номер: 8470
[ Назад ]

Исходное сообщение
"Spawn: nor found"

Отправлено PetrW , 09-Окт-09 10:53 
Здравствуйте:

Пишу скрипт с подключением к удаленному серверу:
После запуска выдается ошибка:
ssh.sh: line 3: spawn: command not found

приходу к выводу, что нужно установить spawn, но где его взять? откуда скачать?
В погугдив ничего не нашел.

Прошу помощи, спасибо.

П.С. Сам скрипт выглядит так:
#!/usr/bin/expect

spawn ssh uХХХХХ.ssh.masterhost.ru -l uХХХХХХХ -x
expect "password:" send "PASS\r"

send "mkdir new\r"
send "exit\r"

expect eof



Содержание

Сообщения в этом обсуждении
"Spawn: nor found"
Отправлено Anonim , 09-Окт-09 11:13 
Может надо установить установить expect?
spawn ключевое слово.

"Spawn: nor found"
Отправлено PetrW , 09-Окт-09 12:01 
>Может надо установить установить expect?
>spawn ключевое слово.

expect установлен:
Вот ответ сервера:
[root@vХХХХ home]# man expect
Formatting page, please wait...
EXPECT(1)                                                            EXPECT(1)

NAME
       expect - programmed dialogue with interactive programs, Version 5

SYNOPSIS
       expect [ -dDinN ] [ -c cmds ] [ [ -[f|b] ] cmdfile ] [ args ]

INTRODUCTION


"Spawn: nor found"
Отправлено Andrey , 09-Окт-09 16:32 
в man expect написано
Expect  reads cmdfile for a list of commands to execute.  Expect may also be invoked implicitly on systems which support the #! notation by marking the script executable, and making the first line in your script:

      #!/usr/bin/expect -f

попробуйте, добавить -f в первую строку скрипта.


"Spawn: nor found"
Отправлено PetrW , 12-Окт-09 17:57 
>в man expect написано
>Expect  reads cmdfile for a list of commands to execute.  
>Expect may also be invoked implicitly on systems which support the
>#! notation by marking the script executable, and making the first
>line in your script:
>
>      #!/usr/bin/expect -f
>
>попробуйте, добавить -f в первую строку скрипта.

тоже не помогло.
Помгла прямая команда: expect -f ssh.sh