<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/19899" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2015-03-24T13:14:50-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/19899</id>

		<entry>
		<author><name><![CDATA[glennsftn]]></name></author>
		<updated>2015-03-24T13:14:50-04:00</updated>

		<published>2015-03-24T13:14:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103653#p103653</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103653#p103653"/>
		<title type="html"><![CDATA[change filenames]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103653#p103653"><![CDATA[
Thanks guys,<br><br>That is exactly what I wanted.  The output was to go to a text file which I could copy/paste into an SSH session.  It would have been ideal to write this in Expect, as I could send the commands I want within the SSH session, but I didn't know how to do the loop with the variables.  I think I have enough now to migrate this over to Expect.  I appreciate the help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12507">glennsftn</a> — Tue Mar 24, 2015 1:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2015-03-24T01:16:59-04:00</updated>

		<published>2015-03-24T01:16:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103645#p103645</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103645#p103645"/>
		<title type="html"><![CDATA[change filenames]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103645#p103645"><![CDATA[
Maybe this is closer to what you say you want...<div class="codebox"><p>Code: </p><pre><code>#!/usr/bin/tcl set src(1) "myfilename1.txt"set src(2) "myfilename2.txt"set src(3) "myfilname3.txt"set dst(1) "mynewfilename1.txt"set dst(2) "mynewfilename2.txt"set dst(3) "mynewfilename3.txt"set count 0 set log [open output.txt w] while {$count &lt; 3} {    incr count   set srcName $src($count)   set dstName $dst($count)   puts $log "mv $srcName $dstName" } close $log</code></pre></div>You should probably have the tcl script actually do the file renaming, and as mentioned above, mv is not a tcl command:)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Tue Mar 24, 2015 1:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[heartbroken]]></name></author>
		<updated>2015-03-24T01:17:51-04:00</updated>

		<published>2015-03-24T01:08:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103644#p103644</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103644#p103644"/>
		<title type="html"><![CDATA[change filenames]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103644#p103644"><![CDATA[
actualy "mv" not a Tcl command. ( <a href="http://www.tcl.tk/man/tcl8.6/TclCmd/contents.htm" class="postlink">http://www.tcl.tk/man/tcl8.6/TclCmd/contents.htm</a> ) you can use file rename : <a href="http://www.tcl.tk/man/tcl/TclCmd/file.htm" class="postlink">http://www.tcl.tk/man/tcl/TclCmd/file.htm</a> - <a href="http://wiki.tcl.tk/10083" class="postlink">http://wiki.tcl.tk/10083</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11703">heartbroken</a> — Tue Mar 24, 2015 1:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[glennsftn]]></name></author>
		<updated>2015-03-23T23:26:10-04:00</updated>

		<published>2015-03-23T23:26:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103643#p103643</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103643#p103643"/>
		<title type="html"><![CDATA[change filenames]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103643#p103643"><![CDATA[
Please excuse my noobiness, I’ve just been learning TCL a few days now and have little coding experience except a rudimentary understanding of Expect.<br><br>I have a NAS with a bunch of files that I’d like to rename.  I want to create a script which will generate the commands to name the files from “this” to “that.”  Below is a quick example of how I’m going about this.  <br><br><div class="codebox"><p>Code: </p><pre><code>#!/usr/bin/tclset src1 myfilename1.txtset src2 myfilename2.txtset src3 myfilname3.txtset dst1 mynewfilename1.txtset dst2 mynewfilename2.txtset dst3 mynewfilename3.txtset count 0set log [open output.txt w]while { $count &lt; 4 } {   set count [incr $count]   set srcName "src$count"   set dstName "dst$count"   puts $log "mv $srcName $dstName"}close $log</code></pre></div>What I would like the output.txt to be is:<br><br>mv myfilename1.txt mynewfilename1.txt<br> ..<br> ..<br>mv myfilename4.txt mynewfilename4.txt<br><br><br>The actual output:<br>$ cat output.txt  <br>mv src1 dst1<br>mv src1 dst1<br>mv src2 dst2<br>mv src1 dst1<br>mv src3 dst3<br>mv src1 dst1<br>mv src4 dst4<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12507">glennsftn</a> — Mon Mar 23, 2015 11:26 pm</p><hr />
]]></content>
	</entry>
	</feed>
