hi i have following expect script named a.exp
#!/usr/bin/expect
spawn cat a.txt
where a.txt contains the following single line of string text
Hello World
next i made it executable by using the following command
chmod +x a.exp
now, i run it as follows
./a.exp
the output i get is as follows
spawn cat a.txt
on the other hand if i use the the following script
puts [exec cat a.txt]
instead of
spawn cat a.txt
it does print the contents of the a.txt file. plz can you help me to execute it using the spawn? thanks!