hi guys
i have such simple script, which i'm executing on AIX 5.3
#!/usr/local/bin/expect
spawn passwd exptest
set password 123
expect "*password:*"
send "$password\r"
expect "*password again:*"
send "$password\r"
expect eof
the output is following:
spawn passwd exptest
sh:... (4 Replies)
Hello all you scripting Gurus,
I have an expect script that gets called from an AppleScript Studio app that basically takes arguments for user name, password, and server address and then calls rsync. Everything works wonderfully, EXCEPT (there had to be one of those) if the user name starts... (4 Replies)
Hi,
I am facing a strange problem while executing a script from a solaris server. This script calls another one to execute "expect" commands on some other 40 servers (all AIX 5200). I am passing username and password to the "expect" script as arguments. My problem is that it is showing the... (4 Replies)
Hi
I'm writing a script which calls an expect script to retrieve configuration files for network devices. I want to avoid using TFTP to transfer the configs if possible and so I'm redirecting the screen output to a text file.
This is the expect script:
#!/usr/local/bin/expect
set... (2 Replies)
hello All,
I am doing SFTP using expect. We just change our server from sun solaris 8 to sun solaris 10.
The script was working good on sun solaris 8.
But it is giving problem on 10. from shell, SFTP is working fine.Please help me.
What can be the problem.
LIB_sftp_get()
{
... (0 Replies)
Hi Im writing an expect program for automating ftp. Having trouble with mget:
expect "ftp>" {send "mget *.txt\r"}
expect "mget*?" {send "n\r" ; expect_continue}
expect "ftp>" {send "bye\r"}
But expect even on ftp prompt "n" gets sent
Please help... (1 Reply)
Hi,
Have strange problem.
When I run an expect script towards a switch, it will not work.
$ ./test2
spawn ssh admin@sesafdd101
Password:
Last login: Thu Dec 25 13:20:54 2008 from 172.20.96.14
ECN430/330/212 Linux, based on Wind River Linux glibc_small (standard) 2.0
Trying... (1 Reply)
i have written simple expect script but it doesnt work the way that i want can someone suggest wat is the issue?
#!/usr/bin/expect
spawn ssh abc@abc
expect "password:"
send "xyz\r"
expect "$"
send "mkdir hello\r"
#sleep 10
#exit 0
output
---------------
it does not create directory... (4 Replies)
Hey there :)
I have a Bash Script and I'm trying to update Roundcube, but theres a user interactive line like:
bin/installto.sh /var/www/mail/rc
Upgrading from 1.1.3. Do you want to continue? (y/N)
I'm trying to avoid this user interaction like this:
cd roundcubemail-1.2.1 >/dev/null... (5 Replies)
Discussion started by: Aeris
5 Replies
LEARN ABOUT SUSE
lassign
lassign(n) Tcl Built-In Commands lassign(n)
__________________________________________________________________________________________________________________________________________________NAME
lassign - Assign list elements to variables
SYNOPSIS
lassign list varName ?varName ...?
_________________________________________________________________DESCRIPTION
This command treats the value list as a list and assigns successive elements from that list to the variables given by the varName arguments
in order. If there are more variable names than list elements, the remaining variables are set to the empty string. If there are more
list elements than variables, a list of unassigned elements is returned.
EXAMPLES
An illustration of how multiple assignment works, and what happens when there are either too few or too many elements.
lassign {a b c} x y z ;# Empty return
puts $x ;# Prints "a"
puts $y ;# Prints "b"
puts $z ;# Prints "c"
lassign {d e} x y z ;# Empty return
puts $x ;# Prints "d"
puts $y ;# Prints "e"
puts $z ;# Prints ""
lassign {f g h i} x y ;# Returns "h i"
puts $x ;# Prints "f"
puts $y ;# Prints "g"
The lassign command has other uses. It can be used to create the analogue of the "shift" command in many shell languages like this:
set ::argv [lassign $::argv argumentToReadOff]
SEE ALSO
lindex(n), list(n), lset(n), set(n)
KEYWORDS
assign, element, list, multiple, set, variable
Tcl 8.5 lassign(n)