![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| #/usr/bin/csh -f not working as expected? | effigy | Shell Programming and Scripting | 4 | 06-05-2006 06:00 PM |
| Var substitution in awk - not working as expected | videsh77 | Shell Programming and Scripting | 3 | 01-13-2006 01:57 PM |
| ls not working as expected within ksh | GNMIKE | Shell Programming and Scripting | 10 | 07-07-2005 08:53 AM |
| awk not working as expected with BIG files ... | videsh77 | Shell Programming and Scripting | 1 | 02-24-2005 04:15 PM |
| which not working as expected | osee | Shell Programming and Scripting | 2 | 09-07-2004 12:37 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
TCL/Expect not working as expected
I am having an issue with TCL\Expect; I am passing arguments via the commandline that are read in via "lrange $argv". One of those var's is a password with characters that need to be escapaed, after escaping them an hitting enter expect is placing curly braces around my password... why?! Code:
#!/usr/bin/expect
## Setting stdin arguments as vars
set user [lrange $argv 0 0]
set password [lrange $argv 1 1]
set bladen [lrange $argv 2 2]
set ilomuser [lrange $argv 3 3]
set ilompasswd [lrange $argv 4 4]
set frame [lrange $argv 5 5]
## Verify that all arguments have been fullfilled
puts "Am citit:\n";
puts "user: $ilomuser";
puts "password: $ilompasswd";
#check if all were provided
if { $user == "" || $password == "" || $bladen == "" || $ilomuser == "" || $ilompasswd == "" || $frame == "" } {
puts "Syntax error\r"
puts "Usage: <Username> <Password> <Blade number in frame> <New ILOM User> <passwd for ILOM user> <Frame IP>\r"
exit 1
}
Example. I ctrl+c to kill.. but as you can see the password has been curly braced. Code:
-(~/work/sun6kchassis/working)------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(14:40 Mon Jul 20)
risk@Heavyarms [161] --> ./setuprilo.exp root thisisapass 3 drrib \$bu\!d1t 1.4.132.123
Am citit:
user: drrib
password: {$bu!d1t}
^Czsh: exit 130 ./setuprilo.exp root thisisapass 3 drrib \$bu!d1t 1.4.132.123
---------- Post updated at 05:53 PM ---------- Previous update was at 02:58 PM ---------- tried it in bash, no avail, also tried quoting, nothing... running out of ideas. |
|
|||||
|
Why aren't you using lindex? Code:
set ilompasswd [lindex $argv 4] Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|