09-23-2008
Thanks a lot... Could you be kind enough to explain what exactly that is doing? I'm new to awk so any input is appreciated... From what I am assuming, it is basically storing names as keys and then taking care that there are no duplicate keys... is it? But still it seems a little surprising to me that it works...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can I have 2 files as in input to the awk command?
Situation is somewhat below,
File A contains number & value delimited by a space.
File B contains number as a part of a line. I am not supposed
to retrieve more than 1 number from a line.
If number from file B matches with number from... (7 Replies)
Discussion started by: videsh77
7 Replies
2. Shell Programming and Scripting
Dear Friends,
I need a shell script.
I am facing a problem while selecting the text that is between start and end tags. and insert the paragraph into a file1, next paragraph in file2......
experts please help.
i have a file which contains,
--------------
<abc> 111some text some text
some... (2 Replies)
Discussion started by: swamymns
2 Replies
3. UNIX for Dummies Questions & Answers
I have a question
I have like 19 different list which contains the name of the server but what I need is just unique ones.
First thing I need to do is just make a unique list within the list itself
i.e. delete anything that is repeated inside the list
like for example
in list1
i... (1 Reply)
Discussion started by: pareshan
1 Replies
4. Shell Programming and Scripting
Hi all,
I have a list of times:
...10:02
15:34
20:05
01:51
06:55
09:00
05:52...
That's just part of the list (its huge).
How do I go about selecting certain times, e.g. just between 23:00 and 05:00 ?? (4 Replies)
Discussion started by: mikejreading
4 Replies
5. Shell Programming and Scripting
Hi All,
I am creating a script that sends log data from text files to a Database and I will like to read sugestions, as I think that there might be better ways to achive this than with my shell script; maybe perl or I don't know, but I will like to read some sugestions.
The log is from... (10 Replies)
Discussion started by: oconmx
10 Replies
6. Shell Programming and Scripting
I all,
i've got this file:
163.162.126 MGW1
163.162.126 MGW2
163.162.126 MGW3
163.162.126 MGW4
163.162.135 RNC3
163.162.135.RNC23
163.162.126. HLR Node A
163.162.126.HLR Node B
163.162.126.HLR Cluster
163.162.126.UMSC3 Node A
163.162.126.UMSC3 Node B
163.162.126.UMSC3... (6 Replies)
Discussion started by: marimovo
6 Replies
7. Shell Programming and Scripting
Say I wanted to select the 5th line of a file without knowing the context of the file. Would I use grep and pipe it into wc or is there a more simple way of doing this? (3 Replies)
Discussion started by: puttster
3 Replies
8. Shell Programming and Scripting
I have a list of files, example as shown below
n02-z30-dsr65-ndelt0.25-varp0.002-4x3drw-csq.msf
n02-z30-dsr65-ndelt0.25-varp0.004-4x3drw-csq.msf
n02-z30-dsr65-ndelt0.25-varp0.006-4x3drw-csq.msf
n02-z30-dsr65-ndelt0.25-varp0.008-4x3drw-csq.msf... (8 Replies)
Discussion started by: kristinu
8 Replies
9. UNIX for Dummies Questions & Answers
Hi Folks,
I have one query that there is a folder in which daily several logs files are getting created , I reached to that location through putty but what I observer that 10 files of different date are been created with same name , what I need to see is the latest file ...let say the location is ... (5 Replies)
Discussion started by: KAREENA18
5 Replies
10. Shell Programming and Scripting
Below is my script code.which shows the environment name and then fetch the file from the ftp server but I am facing one issue.The script should be run in both way.We can pass the arguments with script and select the environment name then file name.Here the issue is I am not able to list the files... (1 Reply)
Discussion started by: anuragpgtgerman
1 Replies
lrange(n) Tcl Built-In Commands lrange(n)
__________________________________________________________________________________________________________________________________________________
NAME
lrange - Return one or more adjacent elements from a list
SYNOPSIS
lrange list first last
_________________________________________________________________
DESCRIPTION
List must be a valid Tcl list. This command will return a new list consisting of elements first through last, inclusive. The index values |
first and last are interpreted the same as index values for the command string index, supporting simple index arithmetic and indices rela- |
tive to the end of the list. If first is less than zero, it is treated as if it were zero. If last is greater than or equal to the number
of elements in the list, then it is treated as if it were end. If first is greater than last then an empty string is returned. Note:
"lrange list first first" does not always produce the same result as "lindex list first" (although it often does for simple fields that are
not enclosed in braces); it does, however, produce exactly the same results as "list [lindex list first]"
EXAMPLES
Selecting the first two elements:
% lrange {a b c d e} 0 1
a b
Selecting the last three elements:
% lrange {a b c d e} end-2 end
c d e
Selecting everything except the first and last element:
% lrange {a b c d e} 1 end-1
b c d
Selecting a single element with lrange is not the same as doing so with lindex:
% set var {some {elements to} select}
some {elements to} select
% lindex $var 1
elements to
% lrange $var 1 1
{elements to}
SEE ALSO
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), lset(n), lreplace(n), lsort(n), string(n) |
KEYWORDS
element, list, range, sublist
Tcl 7.4 lrange(n)