Re: Converting large bash script to TCL
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Converting large bash script to TCL

From: al-s <stosh259@hotmail.com>
Date: Thu Feb 16 2006 - 17:22:45 CET

Hi Ralf,

I tried the mod you suggested and get the following from the error log

can't read "dev": no such variable
can't read "dev": no such variable
    while executing
"string trim $dev"
    ("foreach" body line 2)
    invoked from within
"foreach item [split [gets stdin]] {
                set dev [string trim $dev]
                if {[string length $dev] > 0} {
                        lappend devices $dev
           }
        }"

Looks like dev is not in scope. Is this intedded to work with a STDIN
entry like "sda1 sdb1 sdc1" ? This is how the devices would be
entered. The space will have to be trimmed and each device will have
to be an entry that's accessible in code. Would an array work or is
this better?

Thanks,

-Al
Received on Sun Apr 30 02:07:52 2006