View Full Version : bash: send: command not found

12-Jul-2013, 08:38
i trying to write shell but appears error: "bash: send: command not found". My os: SLES 11 SP1

thanks in advance

12-Jul-2013, 08:54
i trying to write shell but appears error: "bash: send: command not found".

Can you post the script in question (wrap it in CODE tags to make it readable), or if it's really long, just the relevant part? Can you tell us more about what you're trying to do and why you expect there to be a command called send?

My os: SLES 11 SP1

Are you aware that support for SP1 ended in August of 2012? SP3 has just been released.

12-Jul-2013, 10:07
my code

spawn ssh $REMOTE_USER@$REMOTE_HOST 'bash -s' < $SHELL_NAME
match_max 100000
expect "Password:"
send "$PASSWORD\r"
send "\r"

12-Jul-2013, 12:11
Hi ramil85,

it looks like you're having an "expect" script there, not a bash shell script.

from "man 1 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/local/bin/expect -f

Of course, the path must accurately describe where Expect lives. /usr/local/bin is just an example.


12-Jul-2013, 12:17
'send' is a command interpreted by expect. Putting it in your bash script
means you are trying to get 'bash' to interpret it. Instead you probably
need to be pushing these commands into a file and then calling expect with
that file as an argument so that it parses the commands.

Good luck.