Sun 13 Apr 2008
Have you ever wanted to keep notes inside a router instead of an external location? For a few years now, I have thought it would be great is Cisco would include a minimal text editor within the IOS code. It would be nice to have a notes inside the router regarding the last change that was made or other various notes.
In January, Ivan Pepelnjak released an article that show’s how to copy text files into router’s flash through a Telnet session.
This is what I was looking for! Using the following tcl command, I can create a text file in the router’s flash for future reference. This can also be used to build configuration changes in a text file, then use a kron job to implement the changes after hours.
router#tclsh
router(tcl)#
router(tcl)#puts [open "flash:text-file-name" w+] {
+>
+> Enter file text here
+>
+> Or, paste text from another file inside the brackets
+>
+>}
The text for the file need to be enclosed with brackets {}.
Ivan also has another article where you upload a tcl script to the router and create an alias. It is a cleaner solution, but the router needs the tcl script stored before it can work. I like the tcl command better because I don’t have to upload anything to the router (I know it is petty).

(6 votes, average: 4.33 out of 5)








April 14th, 2008 at 8:29 am
Good stuff as usual, Josh.
I’m thinking about implementing something like this as part of the change management process at the office. That way you can see what other engineers have done as long as you have access to the router/switch/whatever.
May 15th, 2008 at 7:31 am
[...] Originally found on Blindhog.net [...]
August 11th, 2008 at 2:54 pm
Interesting, mine is not working… Any ideas?
FRAME1#tclsh
FRAME1(tcl)#puts [open "flash:note.txt" w+] {
+>This is a test to see if I can write a file to flash
+>}
FRAME1(tcl)#tclq
FRAME1#dir
Directory of flash:/
1 -rw- 16138608 c3620-ik9o3s6-mz.123-17a.bin
16777212 bytes total (441844 bytes free)
FRAME1#
August 12th, 2008 at 10:56 pm
@Billy Bob,
Are you doing this on a real router or dynamips?
I had problems in dynamips…
Josh