rename(n) Tcl Built-In Commands rename(n)
__________________________________________________________________________________________________________________________________________________NAME
rename - Rename or delete a command
SYNOPSIS
rename oldName newName
_________________________________________________________________DESCRIPTION
Rename the command that used to be called oldName so that it is now called newName. If newName is an empty string then oldName is deleted.
oldName and newName may include namespace qualifiers (names of containing namespaces). If a command is renamed into a different namespace,
future invocations of it will execute in the new namespace. The rename command returns an empty string as result.
EXAMPLE
The rename command can be used to wrap the standard Tcl commands with your own monitoring machinery. For example, you might wish to count
how often the source command is called:
rename ::source ::theRealSource
set sourceCount 0
proc ::source args {
global sourceCount
puts "called source for the [incr sourceCount]'th time"
uplevel 1 ::theRealSource $args
}
SEE ALSO
namespace(n), proc(n)
KEYWORDS
command, delete, namespace, rename
Tcl rename(n)
Check Out this Related Man Page
delete(n) [incr Tcl] delete(n)
__________________________________________________________________________________________________________________________________________________NAME
delete - delete things in the interpreter
SYNOPSIS
itcl::delete option ?arg arg ...?
_________________________________________________________________DESCRIPTION
The delete command is used to delete things in the interpreter. It is implemented as an ensemble, so extensions can add their own options
and extend the behavior of this command. By default, the delete command handles the destruction of namespaces.
The option argument determines what action is carried out by the command. The legal options (which may be abbreviated) are:
delete class name ?name...?
Deletes one or more [incr Tcl] classes called name. This deletes all objects in the class, and all derived classes as well.
If an error is encountered while destructing an object, it will prevent the destruction of the class and any remaining objects. To
destroy the entire class without regard for errors, use the "delete namespace" command.
delete object name ?name...?
Deletes one or more [incr Tcl] objects called name. An object is deleted by invoking all destructors in its class hierarchy, in
order from most- to least-specific. If all destructors are successful, data associated with the object is deleted and the name is
removed as a command from the interpreter.
If the access command for an object resides in another namespace, then its qualified name can be used:
itcl::delete object foo::bar::x
If an error is encountered while destructing an object, the delete command is aborted and the object remains alive. To destroy an object
without regard for errors, use the "rename" command to destroy the object access command.
delete namespace name ?name...?
Deletes one or more namespaces called name. This deletes all commands and variables in the namespace, and deletes all child names-
paces as well. When a namespace is deleted, it is automatically removed from the import lists of all other namespaces.
KEYWORDS
namespace, proc, variable, ensemble
itcl 3.0 delete(n)
Hi.
What is the easiest way to rename a bunch of files? For example taking all files ending in ".php3" and rename them to end in ".php"
I could write a script to do this, but there is probably an easier way...
Thanks! (17 Replies)
hey all i was writing a script to
1. Rename a file upon the user's request. If the file exists, prompt the user for confirmation before renaming the file. The screen should prompt the user for
a. “Name of file you want to rename.” Use the “\c” escape character.
b. ... (36 Replies)
Hi All,
Can you please help me.
The situation is like this. There are many different file name in this directory.
I have to grep all the file that the name start with "PTWO" and rename it to COM with the current date.
This is the script that I have done and it hit an... (16 Replies)
Hi!
I need help to create a shell script to search inside a file and then copy a portion of the search result as the new file name.
Basically I was hacked over the weekend and the genius wipe out my drive from my server. I was able to recover alot of files, but biggest problem Is now the... (15 Replies)
Greetings,
I am very new to the UNIX shell scripting and would like to learn. However, I am currently stuck on how to process the below sample :
Filename : DOCabcdef24387987ab90d.xml
Pattern "DOC"+any character using and +".xml"
And i want to change the second part of that file (any... (20 Replies)
Hello
I have moved a critical lib from its location, so all programms linked to libc dont work .
I still have two shells on the machine, bash and ksh
The only thing I see is copying back the lib, but of course : dd, cp , mv etc are dead .
So i tryed a loop with read ...
{^Jwhile read... (24 Replies)
Let's say someone accidentally renamed the lib directory in Solaris 8, and now they cannot get into the terminal or even rename the folder via file manager.What would one do? (37 Replies)
hello,
I'm trying to figure out which tool is best for recursively renaming and files or folders using the characters \/*?”<>| in their name. I've tried many examples that use Bash, Python and Perl, but I'm not much of a programmer I seem to have hit a roadblock.
Does anyone have any... (15 Replies)
I have a filename like 1_DATE_3_4.5_888 and I want to modify the date field (ie the last 4 digits ) alone and remove the last field.
Old filename:1_DATE_3_4.5_888
Given date (for eg):120606259532
modified date:120606259899
new filename:1_<modified date>_3.4.5 (14 Replies)
hello
does someone want to help me for this one ?
i want to rename file by inversing parts of filenames separated by the delimiter "--"
sometimes filenames have three strings :
aabb4ccdd eeffgg -- 5566 -- aa78bb ccd eef gghhi.ext
to
aa78bb ccd eef gghhi --... (17 Replies)
hi guys
i have a group of directory like these
p1( 15 - 16 )
p2( 17 -15 )
p1 ( 14 - 20 )
p2 ( 13 -17 )
..
.
.
directories contain numbers represent time
i want to rename all directories and change all numbers in directories' name .
for example
p1( 15 -16 ) will change to... (16 Replies)
so I have about 30k jpg files that I need to rename in one hit. The current filename format is:
x_surname_firstname_y_20141115_OS_(z)
where x, y and z are numbers of various lengths
the new filename format needs to be
surname_firstname_y_OS_(z)
So I basically need to remove the first... (23 Replies)
Hello, This is my first posting and attempt to create a loop using Unix and awk commands. So far this is what I have:
awk -F, 'BEGIN {months ="AP01"; months ="AP02"; months ="AP03";
months ="AP04"; months ="AP05"; months ="AP06";
months ="AP07"; months ="AP08"; months ="AP09";
months... (25 Replies)
Hello,
I need to split a file by number of records and rename each split file with actual filename pre-pended with 3 digit split number.
What I have tried is the below command with 2 digit numeric value
split -l 3 -d abc.txt F (# Will Produce split Files as F00 F01 F02)
How to produce... (19 Replies)
In the below I am trying to rename the contents within each data subfolder in a specific run, based on a partial match of the IonCode_0000_ in each file in the data subdirectory to $1 in f1. There will be multiple runs in f1 but each run in $uniq is unique and will be found in f1 and the rename... (27 Replies)