Здравствуйте:Пишу скрипт с подключением к удаленному серверу:
После запуска выдается ошибка:
ssh.sh: line 3: spawn: command not foundприходу к выводу, что нужно установить spawn, но где его взять? откуда скачать?
В погугдив ничего не нашел.Прошу помощи, спасибо.
П.С. Сам скрипт выглядит так:
#!/usr/bin/expectspawn ssh uХХХХХ.ssh.masterhost.ru -l uХХХХХХХ -x
expect "password:" send "PASS\r"send "mkdir new\r"
send "exit\r"expect eof
Может надо установить установить expect?
spawn ключевое слово.
>Может надо установить установить expect?
>spawn ключевое слово.expect установлен:
Вот ответ сервера:
[root@vХХХХ home]# man expect
Formatting page, please wait...
EXPECT(1) EXPECT(1)NAME
expect - programmed dialogue with interactive programs, Version 5SYNOPSIS
expect [ -dDinN ] [ -c cmds ] [ [ -[f|b] ] cmdfile ] [ args ]INTRODUCTION
в 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 в первую строку скрипта.
>в 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