rename(1T) Tcl Built-In Commands rename(1T)__________________________________________________________________________________________________________________________________________________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(1T), proc(1T)KEYWORDS
command, delete, namespace, rename
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWTcl |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for Tcl is available on http://opensolaris.org.
Tclrename(1T)
Check Out this Related Man Page
global(1T) Tcl Built-In Commands global(1T)__________________________________________________________________________________________________________________________________________________NAME
global - Access global variables
SYNOPSIS
global varname ?varname ...?
_________________________________________________________________DESCRIPTION
This command has no effect unless executed in the context of a proc body. If the global command is executed in the context of a proc body,
it creates local variables linked to the corresponding global variables (and therefore these variables are listed by info locals).
If varname contains namespace qualifiers, the local variable's name is the unqualified name of the global variable, as determined by the
namespace tail command.
EXAMPLES
This procedure sets the namespace variable ::a::x
proc reset {} {
global a::x
set x 0
}
This procedure accumulates the strings passed to it in a global buffer, separated by newlines. It is useful for situations when you want
to build a message piece-by-piece (as if with puts) but send that full message in a single piece (e.g. over a connection opened with socket
or as part of a counted HTTP response).
proc accum {string} {
global accumulator
append accumulator $string
}
SEE ALSO namespace(1T), upvar(1T), variable(1T)KEYWORDS
global, namespace, procedure, variable
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWTcl |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for Tcl is available on http://opensolaris.org.
Tclglobal(1T)
i have a file, which i want to rename, from my current directory to a backupdirectory. My perl code is below
rename($s_filename,$backup.$s_filename ) all my variables are defined. but the rename failed. the file permission my file is "-rw-rw-r--". could this be a problem?
I tried to use the... (9 Replies)
dear all
i have about 5142 file begin with (package jordba."packagename")
i want to remove the package .jordba without touch the package name
i need to stay the package name only
can any body help me
thanx (9 Replies)
Hi,
can anyone have a ksh script to rename multiple files (ie to remove .Z extension of the files)
can someone correct this?
for i in *.Z
do
var1 = substr($i, 1,at(".Z",$i)-1)
mv $i $var1
done
Thanks..
Antony (13 Replies)
here I go again...kinda hard to explain so I apologize.
I need to rename a bunch of files in a directory. I need to remove the first three characters of the filename, and then toward the end of the filename there is constant text inside of brackets. here is a demo (not for real) 'ls -1' of the... (11 Replies)
Hi all -
I'm trying to rename a large number of files all at once and need some help figuring out the command line syntax to do it. I've already done quite a bit of research with the rename and mv commands, but so far haven't found a solution that seems to work for me. So:
The files exist... (10 Replies)
Hello guys, thank God that I found this forum.
I hope that someone can help me because I don't have any idea on how to start it. I know that for some of you this is a very simple task but I'm not as advance on shell scripting like many people out there.
I got this file with a permanent... (10 Replies)
I've a lot of file with an hyphen on filename, so I use rename for remove him ad substitute with an underscore but it fails
$ rename 's/\-/\_/' *
Unknown option: _
Unknown option: i
Unknown option: r
Unknown option: e
Unknown option: e
Unknown option: _
Unknown option: g
Unknown... (12 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 have a txt file which contains a list of file addresses and i want to copy them one by one and rename then regardless what they are to 1,2,3,4,5,....
and since I have the list handy, I could I always know what each file is ;)
So As I tested
cp ./test/t.txt ./test2/2
works well,... (9 Replies)
Hi Guys,
I have a small problem of renaming multiple files. For example I have names of a set of files in one directory like
K2_34625-34675
K7_988963-988983
K12_773882-7734102
and the other set corresponding to the same is
U_P_321_9_3_11.ab1
U_P_322_9_3_11.ab1
U_P_323_9_3_11.ab1
Now... (23 Replies)
hi im new for unix, when i try to rename the file im getting error
$ mv -9file.jpg 9file.jpg
error is
mv: invalid option --"9"
Try 'mv --help' for more information. (10 Replies)
Hi,
i have a file with some data ..look for some specific value in the file and if found that value rename the file with the value found in the file..
ex..
File.txt
1236 43715825601ANDERSSON,
1236 437158256031963040120060901200609010000000
1236 43715825604123 MCCL AVE UPPER
1236 ... (11 Replies)
Hi ,
Please help me am new in shell script how to rename file name as per previouse year
date | cut -c 27-28
mv file XYP.ZAT15.PGPNX.TRDIY
output should display
renamed as
XYP.ZAT15.PGPNX.TRDIY
The file name should be renamed as XYP.ZAT15.PGPNX.TRDIY 15 is the... (9 Replies)
Greetings. I am working in a Linux environment and am trying to figure out a way to rename files in a directory by appending a unique strings that appears within a certain area in those files. I have gotten as far as identifying what that particular unique string is with a command like the... (10 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)