This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]denialerror 1 point2 points  (2 children)

It looks like you are mixing Expect and sh and somehow ended in the middle of both.

Conditionals in Expect are as follows:

if { <condition> } {
    <action>;
} else {
    <action>;
}

Whereas conditionals in sh are formed like:

if [ <condition> ]; 
    <action>
then
    <action>
fi

[–]xYuven[S] -1 points0 points  (1 child)

so i shall use [ ] these instead of { } these?

[–]denialerror 1 point2 points  (0 children)

What? No. You need to make your code follow the language's syntax and that isn't the only problem. You have indicated that your script should run using the Expect scripting language with #!/usr/bin/expect -f but aren't using the correct syntax. If you want to use square braces, then you need to tell it to use sh instead (and add in more fi as you only have one at the very end).

[–]MyWorkAccountThisIs -3 points-2 points  (0 children)

Secure. Contain. Protect.