I have the following in an expect
script
spawn cat version
expect -re 5.*.*
set VERSION $expect_out(0,string)
spawn rpm --addsign dist/foo-$VERSION-1.i686.rpm
The cat
command is getting the version correctly however it appears to be adding a new line. Since I expect the output to be the following:
dist/foo-5.x.x-1.i686.rpm
but am getting including the error at the begining the following:
cannot access file dist/foo-5.x.x
-1.i686.rpm
Why is expect
adding a new line to the cat
command output and is there any way to have this not be done or to fix the output of the cat command?
cat
...cat
that's adding a newline, it's therpm
command that's outputting the error