Skip to content

Tag: expect

TCL Expect is injecting an extra null character to stdout

It seems that expect is adding an extra null character or something to stdout. For example: What is this extra character and how do I get rid of it? Answer It’s not a null character. You can use a tool like xxd to see exactly what output expect is producing: This shows that you are getting a standard CR…

How to run eval spawn ssh and expect in background?

I created a script to get in inside an Access Point (AP) using ssh and execute some commands and I used expect to interact with shell. The scripts works fine when it is running on foreground, but when I try to execute the same script in background using & to fork the process, it stop at spawn ssh command …

How to send BACKSPACE in expect?

I’m trying to automatize some tool, and I have Problem is that by default in prompt is added last product number , for example When I run my expect script in prom is added So how I can tell in except that send BACKSPACE (delete) default product number add set only new one in prompt for example , somethi…

how can i read data from a file in expect script

I looked through this code online but will it read data if it is arragnged in 2 columns like. and so on I would like to assign each TFTP_SERVER_ADDRESS to a variable and use it in my script. furthermore,Is this piece of code secure : Answer Sample Script that reads data from a file and then calls an expect sc…

Hide output from expect

Here’s part of an expect script It read password from kwalletcli, and store in variable passwd. So I can connect to the servers with this passwd. However, the output of kwalletcli is pass through expect and show on console. How can I hide that. Answer Try adding to your script. That should turn off the …