Selecting one file from a list


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Selecting one file from a list
# 8  
Old 09-28-2008
wow..

awesome rubin...thanks for the Idea!Smilie

Quote:
Originally Posted by rubin
Code:
ls rib* | awk -F. '!a[$2]++' | xargs -i cp -p  '{}' /path/to/other_dir

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List the file names available on FTP server before selecting the required file

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

2. UNIX for Dummies Questions & Answers

Selecting the file of latest Date

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

3. Shell Programming and Scripting

Selecting files from a list and passing them to a program using csh

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

4. Shell Programming and Scripting

Selecting lines of a file

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

5. Shell Programming and Scripting

Cut a file in two file selecting a row

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

6. Shell Programming and Scripting

Selecting Lines on text file

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

7. Shell Programming and Scripting

Selecting certain times from a list

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

8. UNIX for Dummies Questions & Answers

Selecting Unique Values from many List

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

9. Shell Programming and Scripting

selecting each paragraph and put it into a file...help me

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

10. Shell Programming and Scripting

Selecting records from file on criteria.

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
Login or Register to Ask a Question
lrange(3tcl)						       Tcl Built-In Commands						      lrange(3tcl)

__________________________________________________________________________________________________________________________________________________

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(3tcl), lappend(3tcl), lindex(3tcl), linsert(3tcl), llength(3tcl), lsearch(3tcl), lset(3tcl), lreplace(3tcl), lsort(3tcl), string(3tcl) | KEYWORDS
element, list, range, sublist Tcl 7.4 lrange(3tcl)