when you are using expect, echo is not a valid command. If you are going to use other commands not recognizable by expect, you might need to use 2 scripts one calling your expect script. I'm not an expert on expect but the workaround we had to go around this issue it to use 2-3 scripts.