Can someone explain why this keeps failing?
set hostname ""
if {$hostname eq ""} {
puts "Usage: host [-u username] [-p password] [-f]"
exit 5
}
if {[string length $hostname] == 0} {
puts "Usage: host [-u username] [-p password] [-f]"
exit 5
}
if {[string equal $hostname ""]} {
puts "Usage: host [-u username] [-p password] [-f]"
exit 5
}
I get the following error:
invalid command name "-u"
while executing
"-u username"
invoked from within
"if {$s eq ""} {puts "Usage: host [-u username] [-p password] [-f]"}"
The code seems to execute fine but I can't seem to use puts with a string that contains braces.