Sponsored Content
Full Discussion: File Format in TCL
Top Forums UNIX for Advanced & Expert Users File Format in TCL Post 302530290 by sarbjit on Monday 13th of June 2011 12:24:37 PM
Old 06-13-2011
Try this

Code:
proc ls filename {
set file_newname [clock format [file mtime $filename] -format %d_%b_%Y_%H_%M_%S]
file copy -force $filename ${filename}_${file_newname}
}

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File Handler in TCL

Hai , I Have Some x.txt file in which has the following data x.txt HI, How Are u r u fine /home/Sanju/samp.html /root/Sanju/design/sample now in tcl i have the following script set fp while { >= 0 } { puts $line ... (1 Reply)
Discussion started by: sanjustudy
1 Replies

2. UNIX for Advanced & Expert Users

Convert UTF8 Format file to ANSI format

:) Hi i am trying to convert a file which is in UTF8 format to ANSI format i tried to use the function ICONV but it is throwing error Function i used it as $ iconv -f UTF8 -t ANSI filename Error iam getting is NOT Supported UTF8 to ANSI please some help me out on this.........Let me... (1 Reply)
Discussion started by: rajreddy
1 Replies

3. UNIX for Dummies Questions & Answers

Convert UTF8 Format file to ANSI format

:confused: Hi i am trying to convert a file which is in UTF8 format to ANSI format i tried to use the function ICONV but it is throwing error Function i used it as $ iconv -f UTF8 -t ANSI filename Error iam getting is NOT Supported UTF8 to ANSI please some help me out on... (9 Replies)
Discussion started by: rajreddy
9 Replies

4. UNIX for Dummies Questions & Answers

Reading line from file - TCL

I Have output of ps -ef in file. while reading from file, it reads one word but i want to read the full line. Is there any way to set IFS in TCL as we set in Shell. Thanks Ajay Kumar (2 Replies)
Discussion started by: aju_kup
2 Replies

5. UNIX for Dummies Questions & Answers

To convert multi format file to a readable ascii format

Hi I have a file which has ascii , binary, binary decimal coded,decimal & hexadecimal data with lot of special characters (like öƒ.ƒ.„İİ¡Š·œƒ.„İİ¡Š· ) in it. I want to standardize the file into ASCII format & later use that as source . Can any one suggest a way a logic to convert such... (5 Replies)
Discussion started by: gaur.deepti
5 Replies

6. Shell Programming and Scripting

Converting windows format file to unix format using script

Hi, I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix. My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies

7. Programming

Parsing a text file in Tcl

Hi all, I need to parse through a text file searching for a specific string, then after I find this string read in remaining data off the line to a variable. I've tried various things and can't seem to get any to work. Any help would be much appreciated. (2 Replies)
Discussion started by: caboose57
2 Replies

8. Programming

TCL reading file

This is the code i have to read and display each line every time. please let me know the bug in this.. am not getting the output set fp set file_data close $fp set data foreach line $data { puts $data } content of abc.txt is ... (1 Reply)
Discussion started by: Syed Imran
1 Replies

9. Programming

File handling in TCL

Hi, I have n number of files in a directory with extension .PGM i need to store the full path name in a variable and only the file name with extension in another variable. Each time i'll be using the next file name for manipulation. Please help me out to do this using TCL thanks (1 Reply)
Discussion started by: Syed Imran
1 Replies

10. Shell Programming and Scripting

Need to call tcl function from other file !!

Hi, Can a function written in tcl in some other file be called in unix scripts ? Like this ? This is my code now--- shell.sh: #!/bin/bash tclsh snmpv2-conf-sam.tcl $SERVER $NODESYSIP $SPASSWD but i need this in a different way like , without having a .tcl file i want the... (2 Replies)
Discussion started by: giri_luck
2 Replies
TclXInit(TCL)                                                                                                                        TclXInit(TCL)

NAME
Tclx_Init, Tclxcmd_Init, TclX_Main, Tkx_Init, TkX_Main - Extended Tcl initialization. SYNOPSIS
-ltclx -ltcl #include "tclExtend.h" int Tclx_Init (Tcl_Interp *interp); int Tclxcmd_Init (Tcl_Interp *interp); int void TclX_Main (int argc, char **argv, Tcl_AppInitProc *appInitProc); int Tkx_Init (Tcl_Interp *interp); void TkX_Main (int argc, char **argv, Tcl_AppInitProc *appInitProc); void TclX_SetAppInfo (int defaultValues, char *appName, char *appLongName, char *appVersion, int appPatchlevel); DESCRIPTION
These functions are used to initialize Extended Tcl and applications based on Extended Tcl. This manual page also discusses various issues and approaches of integrating TclX into other applications. Tclx_Init Initializes Extended Tcl, adding the extended command set to the interpreter. This is called from Tcl_AppInit. This function must be called after the Tcl_Init function. In addition to the standard command set, it enables use of tlib packages libraries and makes the stan- dard TclX library available. Parameters o interp - A pointer to the interpreter to add the commands to. Returns: TCL_OK if all is ok, TCL_ERROR if an error occurred. Tclxcmd_Init Add the TclX command set to the interpreter, with the exception of the TclX library management commands. This is normally called by Tclx_Init and should only be used if you don't want the TclX library handling. Parameters o interp - A pointer to the interpreter to add the commands to. Returns: TCL_OK if all is ok, TCL_ERROR if an error occurred. TclX_Main This function parses the command line according to the TclX shell specification (Unix shell compatible). It creates an interpreter and calls the specified function appInitProc to initialize any application specific commands. It then either evaluates the command of script specified on the command line or enters an interactive command loop. This procedure never returns, it exits the process when it's done. Using the TclX shell also gives you SIGINT handling in interactive shells. Tkx_Init Initializes Extended Tcl Tk environment. This is called from Tcl_AppInit after the Tk_Init function. Parameters o interp - A pointer to the interpreter to add the commands to. Returns: TCL_OK if all is ok, TCL_ERROR if an error occurred. TkX_Main This function parses the command line according to the wish shell specification. It creates an interpreter and calls the specified func- tion appInitProc to initialize any application specific commands. It then either evaluates the command of script specified on the command line or enters an interactive command loop. This procedure never returns, it exits the process when it's done. Using the TclX wish shell gives you SIGINT handling in interactive shells, otherwise it is identical to standard wish. TclX_SetAppInfo Store the application information returned by infox. Parameters o defaultValues - If true, then the values are assigned only if they are not already defined (defaulted). If false, the values are always set. o appName - Application symbolic name. o appLongName - Long, natural language application name. o appVersion - Version number of the application. o appPatchlevel - Patch level of the application. If less than zero, don't change. String pointers are saved without copying, don't release the memory. If the arguments are NULL, don't change the values. DYNAMIC LOADING OF TCLX
TclX can be dynamically loaded on systems that support shared libraries and the load command. This can be done using either the load or the package require commands. If package require is to be used, a pkgIndex,tcl must be constructed. The pkg_mkIndex does not generate a pkgIndex.tcl file that works with TclX. Instead a command similar to package ifneeded Tclx 7.5.0 "load $dir/libtclx.so" should be placed in the directory containing the TclX shared library. A prototype pkgIndex,tcl file is build by TclX and is installed in the run time directory under the name pkgIndex,proto. This file can't be used as-is, but should be renamed and copied or combined with an existing pkgIndex,tcl in the directory containing the shared library. There is no need to dynamically load libtkx.so, since it only contains support for wishx. INTEGRATING TCLX WITH OTHER EXTENSIONS AND APPLICATIONS
The main aspects to integrating TclX with into an application is to decide if the application is based on the standard Tcl/Tk shells or the TclX shells. If the standard shells are desired, then all that is necessary is to call Tclx_Init after Tcl_Init and Tkx_Init after Tk_Init. This functionality may also be dynamically loaded. To get the TclX shell in a Tcl only application, with the tcl command functionality, call TclX_Main from the main function instead of Tcl_Main. This shell has arguments conforming to other Unix shells and SIGINT signal handling when interactive,. To get the Tclx shell in a Tk application, with the wishx command functionality, call TkX_Main from the main function instead of Tk_Main. This shell has SIGINT signal handling when interactive, Tcl TclXInit(TCL)
All times are GMT -4. The time now is 07:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy