Sponsored Content
Top Forums Shell Programming and Scripting Searching for file and stopping at first item found Post 302330704 by pludi on Thursday 2nd of July 2009 04:52:39 AM
Old 07-02-2009
Pipe it into head, eg
Code:
find /path -type f -name '*.doc' -print | head -1

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Stopping tail -f when certain string found?

Hi, I need to monitor a log file for a certain string ("Phase 2 ended") which indicates that the job which creates the log file has finished loading its data file. Once the string "Phase 2 ended" is found in the log file I would then like to stop checking that log and check to see if another... (3 Replies)
Discussion started by: jake657
3 Replies

2. IP Networking

Firewall stopping Peer to Peer File sharing

I am looking for advice on a router. I am new to Linux and am trying to use Limewire and Ktorent and can make no connection. Limewire indicates I have a firewall. I have a Linksys router WRK54G and my guess is that is the problem. I have spent hours upon hours trying to get it to work using info... (0 Replies)
Discussion started by: Paul K
0 Replies

3. Shell Programming and Scripting

Reading each item from a formatted file

Hi, I have a file generated like this - 1. Fire SQL and store the formatted output in a temp file echo "select path, empid, age from emp_tbl" | /usr/sql emp_db 2 > count_file | grep vol > tempFile 2. The tempFile looks like this after the above statement /vol/emp1 0732 ... (9 Replies)
Discussion started by: angshuman_ag
9 Replies

4. Shell Programming and Scripting

Print new item in file with symbol

Dear all, I have encountered some problem here. I prompt the user for input and store it into a data file, eg. key in name and marks so the data file will look like this andrew 80 ben 75 and the next input is carine 90. So the problem here is i want to print... (2 Replies)
Discussion started by: branred
2 Replies

5. UNIX for Dummies Questions & Answers

Help with searching for a file in a directory and copying the contents of that file in a new file

Hi guys, I am a newbie here :wall: I need a script that can search for a file in a directory and copy the contents of that file in a new file. Please help me. :confused: Thanks in advance~ (6 Replies)
Discussion started by: zel2zel
6 Replies

6. Shell Programming and Scripting

searching a file with a specified text without using conventional file searching commands

without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Discussion started by: arindamlive
5 Replies

7. Programming

Storing C++-struct in file - problem when adding new item in struct

Hi, I have received an application that stores some properties in a file. The existing struct looks like this: struct TData { UINT uSizeIncludingStrings; // copy of Telnet data struct UINT uSize; // basic properties: TCHAR szHost; //defined in Sshconfig UINT iPortNr; TCHAR... (2 Replies)
Discussion started by: Powerponken
2 Replies

8. Shell Programming and Scripting

Read a lis, find items in a file from the list, change each item

Hello, I have some tab delimited text data, file: final_temp1 aname val NAME;r'(1,) 3.28584 r'(2,)<tab> NAME;r'(3,) 6.13003 NAME;r'(4,) 4.18037 r'(5,)<tab> You can see that the data is incomplete in some cases. There is a trailing tab after the first column for each incomplete row. I... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

9. UNIX for Beginners Questions & Answers

Zabbix item for last line of a log file

Dear all,Zabbix version : 2.4 (yes, I know, upgrading soon - honest) Server OS version : CentOS 6, 64-bit (CentOS 7 with the Zabbix upgrade)I've got a large log file that I would like to read by an external process. It's basically the same as reading the item value on a web-page. I have... (5 Replies)
Discussion started by: rbatte1
5 Replies

10. Shell Programming and Scripting

Script to process a list of items and uncomment lines with that item in a second file

Hello, I have a src code file where I need to uncomment many lines. The lines I need to uncomment look like, C CALL l_r(DESNAME,DESOUT, 'Gmax', ESH(10), NO_APP, JJ) The comment is the "C" in the first column. This needs to be deleted so that there are 6 spaces preceding "CALL".... (7 Replies)
Discussion started by: LMHmedchem
7 Replies
QPtrQueue(3qt)															    QPtrQueue(3qt)

NAME
QPtrQueue - Template class that provides a queue SYNOPSIS
#include <qptrqueue.h> Public Members QPtrQueue () QPtrQueue ( const QPtrQueue<type> & queue ) ~QPtrQueue () QPtrQueue<type> & operator= ( const QPtrQueue<type> & queue ) bool autoDelete () const void setAutoDelete ( bool enable ) uint count () const bool isEmpty () const void enqueue ( const type * d ) type * dequeue () bool remove () void clear () type * head () const operator type * () const type * current () const Protected Members virtual QDataStream & read ( QDataStream & s, QPtrCollection::Item & item ) virtual QDataStream & write ( QDataStream & s, QPtrCollection::Item item ) const DESCRIPTION
The QPtrQueue class is a template class that provides a queue. QValueVector can be used as an STL-compatible alternative to this class. A template instance QPtrQueue<X> is a queue that operates on pointers to X (X*). A queue is a first in, first out structure. Items are added to the tail of the queue with enqueue() and retrieved from the head with dequeue(). You can peek at the head item without dequeing it using head(). You can control the queue's deletion policy with setAutoDelete(). For compatibility with the QPtrCollection classes, current() and remove() are provided; both operate on the head(). See also QPtrList, QPtrStack, Collection Classes, and Non-GUI Classes. MEMBER FUNCTION DOCUMENTATION
QPtrQueue::QPtrQueue () Creates an empty queue with autoDelete() set to FALSE. QPtrQueue::QPtrQueue ( const QPtrQueue<type> & queue ) Creates a queue from queue. Only the pointers are copied; the items are not. The autoDelete() flag is set to FALSE. QPtrQueue::~QPtrQueue () Destroys the queue. Items in the queue are deleted if autoDelete() is TRUE. bool QPtrQueue::autoDelete () const Returns the setting of the auto-delete option. The default is FALSE. See also setAutoDelete(). void QPtrQueue::clear () Removes all items from the queue, and deletes them if autoDelete() is TRUE. See also remove(). uint QPtrQueue::count () const Returns the number of items in the queue. See also isEmpty(). type * QPtrQueue::current () const Returns a pointer to the head item in the queue. The queue is not changed. Returns 0 if the queue is empty. See also dequeue() and isEmpty(). type * QPtrQueue::dequeue () Takes the head item from the queue and returns a pointer to it. Returns 0 if the queue is empty. See also enqueue() and count(). void QPtrQueue::enqueue ( const type * d ) Adds item d to the tail of the queue. See also count() and dequeue(). type * QPtrQueue::head () const Returns a pointer to the head item in the queue. The queue is not changed. Returns 0 if the queue is empty. See also dequeue() and isEmpty(). bool QPtrQueue::isEmpty () const Returns TRUE if the queue is empty; otherwise returns FALSE. See also count(), dequeue(), and head(). QPtrQueue::operator type * () const Returns a pointer to the head item in the queue. The queue is not changed. Returns 0 if the queue is empty. See also dequeue() and isEmpty(). QPtrQueue<;type> & QPtrQueue::operator= ( const QPtrQueue<type> & queue ) Assigns queue to this queue and returns a reference to this queue. This queue is first cleared and then each item in queue is enqueued to this queue. Only the pointers are copied. Warning: The autoDelete() flag is not modified. If it it TRUE for both queue and this queue, deleting the two lists will cause double- deletion of the items. QDataStream &; QPtrQueue::read ( QDataStream & s, QPtrCollection::Item & item ) [virtual protected] Reads a queue item, item, from the stream s and returns a reference to the stream. The default implementation sets item to 0. See also write(). bool QPtrQueue::remove () Removes the head item from the queue, and returns TRUE if there was an item, i.e. the queue wasn't empty; otherwise returns FALSE. The item is deleted if autoDelete() is TRUE. See also head(), isEmpty(), and dequeue(). void QPtrQueue::setAutoDelete ( bool enable ) Sets the queue to auto-delete its contents if enable is TRUE and not to delete them if enable is FALSE. If auto-deleting is turned on, all the items in a queue are deleted when the queue itself is deleted. This can be quite convenient if the queue has the only pointer to the items. The default setting is FALSE, for safety. If you turn it on, be careful about copying the queue: you might find yourself with two queues deleting the same items. See also autoDelete(). QDataStream &; QPtrQueue::write ( QDataStream & s, QPtrCollection::Item item ) const [virtual protected] Writes a queue item, item, to the stream s and returns a reference to the stream. The default implementation does nothing. See also read(). SEE ALSO
http://doc.trolltech.com/qptrqueue.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qptrqueue.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QPtrQueue(3qt)
All times are GMT -4. The time now is 08:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy