I'm trying to write an expect script (for the first time) and what I'm trying to do is read lines from a text file (input.txt) and assign them as specific variables in an expect script. My text file takes input from a web app and will have exactly 5 lines (5 variables for my script). Since I already know what each line represents, I want to create specifically-named variables for them..
line 1 is $user
line 2 is $password
line 3 is $logs1
line 4 is $logs2
line 5 is $containerName
I've looked at this link: Read file into String and do a loop in Expect Script and see that they used
set f [open "host.txt"]
set hosts [split [read $f] "\n"]
close $f
to collect from a file of all host names and just iterate through them in a loop but how do I name each line differently according to what the line represents?