Re: Problem with if/else



Hi Dan,

couple of things.

handle eof in expect

if { "$stringA" == "$stringB" }

you wrote "=" but need towrite "=="

And imho the better way would be to use [switch]
instead of endless if else if ...

switch -exact -- $value \
$couldbe1 {
# action for first possible value
........
} $couldbe2 {
# action for other value
............
} default {
# default action
..............
}

is "hard(config:noe" really on the same line?

uwe
.



Relevant Pages

  • Re: match program example
    ... When you reach EOF on a file, move hi-vals to the key as well as ... You'll also come across some variations in on-line pgms and also ... Input data is usually presented to a pgm in some sort sequence, ... How can the loops be executed if the "is-finished" switch has already ...
    (comp.lang.cobol)
  • Re: Recent change in less(1)
    ... switch, i.e. quit when EOF is hit twice always (thus whether or not ...
    (freebsd-current)
  • Re: feedback, comments on this php-delimiter scrubbing program?
    ... As has been hinted before you're not handling the EOF case. ... and decide based on the state, rather then inlined switch statements, if only ... int results=0; ... putchar; ...
    (freebsd-questions)
  • Re: difference in files being copied by scp from Unix to VMS
    ... I am using the position of the EOF byte of the first file and setting ... use the /ASCII switch on the scp command. ...
    (comp.os.vms)
  • Re: Fantastic 5 Way Switch
    ... Keith Adams wrote: ... It has the capability of making those 5 ... Yamaha's 5 way switch is awsome. ... endless. ...
    (alt.guitar)