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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)