Well this isn't really a Vtcl question but I am using Vtcl and trying to completely 
learn Tcl/Tk, so here goes.

I want to do a tail on a file for the last line and then split up the line so I can 
manipulate the data, so I thought I could do this:

set b [tail -1 filename]
set c [split $b]

then do whatever to the list that is now in $c......Well when I try this I get $b and 
$c empty , I have done this in a tcl shell and I get an echo back from the tail of 
what I  expect however if i then say  puts stdout $b the variable is empty.

What I really am trying to do is the tcl equivalent of this piece of perl code:

---------------Start Snipit--------------------------------------

$rclocal = `tail -1 /etc/rc.d/rc.local`;

($rc1,$rc2,$rc3,$ip4,$rc5,$eth) = split(/ /,$rclocal);
$ip4 = $ip;

($eth1,$eth2) = split(/:/,$eth);
$eth2 +=1;
$eth = join(':',$eth1,$eth2);

$rclocal = join(' ',$rc1,$rc2,$rc3,$ip4,$rc5,$eth);

-------------------------End Snipit--------------------------------

and then I will append this data back to the file it was read from.

Any and all help with this would be fantastic, and if there is anyone who would like 
to be a "answer stupid questions pen pal" to help me learn this I would be really, 
really, really, greatful.

Thanks in Advance,


Chris Hood
[EMAIL PROTECTED]
[EMAIL PROTECTED]

 
         /  There can be only One!
 *//////{<>==============================================-
         \   - Highlander



---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).

Reply via email to