Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tell(n) [centos man page]

tell(n) 						       Tcl Built-In Commands							   tell(n)

__________________________________________________________________________________________________________________________________________________

NAME
tell - Return current access position for an open channel SYNOPSIS
tell channelId _________________________________________________________________ DESCRIPTION
Returns an integer string giving the current access position in channelId. This value returned is a byte offset that can be passed to seek in order to set the channel to a particular position. Note that this value is in terms of bytes, not characters like read. The value returned is -1 for channels that do not support seeking. ChannelId must be an identifier for an open channel such as a Tcl standard channel (stdin, stdout, or stderr), the return value from an invocation of open or socket, or the result of a channel creation command provided by a Tcl extension. EXAMPLE
Read a line from a file channel only if it starts with foobar: # Save the offset in case we need to undo the read... set offset [tell $chan] if {[read $chan 6] eq "foobar"} { gets $chan line } else { set line {} # Undo the read... seek $chan $offset } SEE ALSO
file(n), open(n), close(n), gets(n), seek(n), Tcl_StandardChannels(3) KEYWORDS
access position, channel, seeking Tcl 8.1 tell(n)

Check Out this Related Man Page

tell(n)                                                        Tcl Built-In Commands                                                       tell(n)

__________________________________________________________________________________________________________________________________________________

NAME
tell - Return current access position for an open channel SYNOPSIS
tell channelId _________________________________________________________________ DESCRIPTION
Returns an integer string giving the current access position in channelId. This value returned is a byte offset that can be passed to seek in order to set the channel to a particular position. Note that this value is in terms of bytes, not characters like read. The value returned is -1 for channels that do not support seeking. ChannelId must be an identifier for an open channel such as a Tcl standard channel (stdin, stdout, or stderr), the return value from an invocation of open or socket, or the result of a channel creation command provided by a Tcl extension. EXAMPLE
Read a line from a file channel only if it starts with foobar: # Save the offset in case we need to undo the read... set offset [tell $chan] if {[read $chan 6] eq "foobar"} { gets $chan line } else { set line {} # Undo the read... seek $chan $offset } SEE ALSO
file(n), open(n), close(n), gets(n), seek(n), Tcl_StandardChannels(3) KEYWORDS
access position, channel, seeking Tcl 8.1 tell(n)
Man Page

14 More Discussions You Might Find Interesting

1. Programming

Any one can tell me how this happen?

The #1 Online Store for Louis Vuitton Replicas is: http://www.opichina.com.cn. We offer Louis Vuitton Replicas and more! Whatever you call it: LV Bags, LV Replicas, Louis Vuitton Fake, Louis Vuitton Knockoffs, Louis Vuitton Bag, Louis Vuitton Purse, Louis Vuitton Wallet, Louis Vuitton Shoes,... (10 Replies)
Discussion started by: jiangyanna
10 Replies

2. Shell Programming and Scripting

tell me how many specific characters there are?

i'm trying to get the user to enter a character, then the script should search for how many of that character exists in the file. I have the following code, but it doesn't work properly and it shows the wrong amount (i don't think im supposed to use grep). For example, I want it to say, "There are... (7 Replies)
Discussion started by: kev269
7 Replies

3. UNIX for Dummies Questions & Answers

ssh1 ssh2 how to tell which version i have?

upon entering the command:ssh -v I get this:OpenSSH_4.4p1, OpenSSL 0.9.8d 28 Sep 2006 how do i identify whether or not i have ssh1 or ssh2? thanks in advance (10 Replies)
Discussion started by: EWTGPAC
10 Replies

4. Shell Programming and Scripting

Awk: Can anyone tell me why this doesn't work?

If there exists a field in stdin, print it, otherwise, print hello..... These print nothing: cat /dev/null | awk '{if ( length > 0 ) print $1; else print "hello"}' cat /dev/null | awk '{if ( $1 ) print $1; else print "hello"}'But the scripts work if I run them directly in a terminal: ... (8 Replies)
Discussion started by: ksheller
8 Replies

5. Shell Programming and Scripting

How to tell which shell is running a script

I've been searching for a while and haven't found this answer anywhere. How can I tell which shell is running my script from within the script? For example, I have lots of older scripts that we are porting to a new Linux system. Many of the scripts start with ":" alone on a line, which I think... (12 Replies)
Discussion started by: sbaker
12 Replies

6. Solaris

Group Permissions - How to tell the difference

I am a member of a few different user groups. I would like to see what the difference is.... Can anyone tell me how to look at permissions side by side ? We are using : SunOS xxxxxx 5.10 Generic_127111-09 sun4u sparc SUNW,Sun-Fire-V440 Thanks ! (10 Replies)
Discussion started by: popeye
10 Replies

7. Solaris

How can I tell if a file is zipped or not?

SunOS xxxxxx 5.10 Generic_142900-15 sun4v sparc SUNW,T5240 We receive files that are sometimes zipped, but the file may not have the .gz or other extention that would indicated that the file is zipped. Is there a unix "test" command that I could use or something similar? Thanks in advance (7 Replies)
Discussion started by: Harleyrci
7 Replies

8. UNIX for Dummies Questions & Answers

How to tell if a process is running?

Hi all, please excuse the newby question. I run OSX servers with Filemaker and Terascript (formerly Witango, before that Tango). Terascript talks to Filemaker via JDBC so I have installed the Filemaker Xdbc extensions (JDBC, ODBC). It is a listener process that waits for JDBC commands and... (28 Replies)
Discussion started by: AusS2000
28 Replies

9. Shell Programming and Scripting

[Solved] intelligent splitting?

Hi, I want to split a file into multiple ones, with a new file for every line in the old file. Typically it is in this format 0.25 20 35.7143 0.5 31 55.3571 0.85 3 5.35714 1.3 2 3.57143 I can make new files by using split or other simple awk commands. But sometimes, the file is like... (7 Replies)
Discussion started by: jamie_123
7 Replies

10. Shell Programming and Scripting

script to tell whether there exists directory or not

Hi, I am writing a script as follows: #!/bin/sh set -x for i in `cat a`; do #sleep 3 print $i >> server.txt sleep 5 if test -d `vtask $i "' ls -lrt /opt/log/ '" ` ; then print $i >> 12.5.txt else print $i >> 12.0.txt fi done (7 Replies)
Discussion started by: dbashyam
7 Replies

11. Shell Programming and Scripting

Can anyone tell me what's wrong here...

Here is my code.... just want to compare column 1 and 2 of file 2 with file 1 as standard file and print file 2 all contents with matched index value stored in $8 of file 1 awk 'NR==FNR{ A=$0;B++;next} {print A?$0 FS B: $0 FS "Not-Found" }' FS="\t" file1 file2 here B is not printing if... (19 Replies)
Discussion started by: Akshay Hegde
19 Replies

12. Red Hat

Could any one tell me how to assign IP to a linux box.

Hi All, Could any one please help me how to assign IP to a linux box permanently. IP should not be changed even after Rebooting the machine.:b::b::b: (8 Replies)
Discussion started by: vamshigvk475
8 Replies

13. Shell Programming and Scripting

Intelligent Script to Insert Records in Database Table

Hello All Members, I am new to this forum and to the shell scripting. I want to write a shell script to do the following: Scenario: I have a pipe delimited .txt file with multiple fields in it. The very first row of the file contains the name of the column which resembles the name of the... (18 Replies)
Discussion started by: chetanojha
18 Replies

14. AIX

Clone 1 Hard disk fromIBM Intellipoint server with AIX 5.x

Hello to all, Im having a new task in a new world (AIX - IBM Servers) I have an IBM Server (Type - 9111-285 very old one) with one Hard disk (73 GB 10 K) with AIX 5.x, and I need to clone the existing disk to another with the same specifications. Could you please give me some advice in order... (7 Replies)
Discussion started by: trevian3969
7 Replies