Sponsored Content
Top Forums Shell Programming and Scripting Finding my lost file by searching for words in it Post 302541500 by yazu on Monday 25th of July 2011 12:02:17 AM
Old 07-25-2011
The main question - if you want find files with ALL your words or just with ANY of your words.

For the latter grep command is enough, for the former - you need a script. Whether this script will get your patterns (words) from a file or on the command line - it's not a problem at all. You can change my script like this (you can't have patterns-words with spaces though but it's easy enough to modify the script to catch it) :

Code:
# usage: ./script WORDS_FILE PATH 

words=`cat $1`
mypath=$2
...

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to find capital letter names in a file without finding words at start of sentence

Hi, I want to be able to list all the names in a file which begin with a capital letter, but I don't want it to list words that begin a new sentence. Is there any way round this? Thanks for your help. (1 Reply)
Discussion started by: kev269
1 Replies

2. UNIX for Dummies Questions & Answers

searching and displaying most commonly used words

Hi guys, i need to search the most commonly occuring words in a file and display their counts of about 30000 words and the words shud not be of typ specified in file 2 e. words like is,for,the,an,he,she etc... k. file1: ALICE was beginning to get very tired of sitting by... (2 Replies)
Discussion started by: arunsubbhian
2 Replies

3. Shell Programming and Scripting

Searching words in a file containing a pattern

Hi all, I would like to print words in a file seperated by whitespaces containing a specific pattern like "=" e.g. I have a file1 containing strings like %cat file1 The= some= in wish= born <eof> .I want to display only those words containing = i.e The= , some=,wish= ... (5 Replies)
Discussion started by: sree_123
5 Replies

4. Shell Programming and Scripting

searching for words between delimeters from the rear

Hi, i need to pick up dates and times from the file names which are of unequal length. The dates and time are delimited by dot. I am interested in getting the strings between the delimeter for fields -3, -4, -5 from behind (rear) so that the out put looks like : 071118.011300.556 I have... (2 Replies)
Discussion started by: oktbabs
2 Replies

5. Shell Programming and Scripting

Perl searching special words in lines

Hi , i am a new with perl, i want to made a script that find in file rows that start with specil words, as an example a line will start with" ............................................. specialword aaa=2 bbb=5 ............................................. and to put this in a new file... (3 Replies)
Discussion started by: alinalin
3 Replies

6. Shell Programming and Scripting

Finding the number of unique words in a file

find the number of unique words in a file using sort com- mand. (7 Replies)
Discussion started by: abhikamune
7 Replies

7. UNIX for Dummies Questions & Answers

Searching for multiple words on a line in any order issue

Hi again I have figured out how to be able to sort through lines in a file with multiple words in any order and display them using this command: cat file | grep -i $OPTION1 | grep -i $OPTION2 | grep -i $OPTION3 OPTION1 is 2008, OPTION2 is Mar, OPTION 3 is Tue Result: Tue Mar 25... (4 Replies)
Discussion started by: semaj
4 Replies

8. Shell Programming and Scripting

Finding consecutive same words in a file

Hi All, I tried this but I am having trouble formulating this: I have a file that looks like this (this is a sample file words can be different): network router frame network router computer card host computer card One can see that in this file "network" and "router" occur... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

9. UNIX for Dummies Questions & Answers

searching words & print prefixed string after it

I have a text which I divided them into sentences and now printed them in a rows. I want to get the list of most of words ( the, and, a) and print 5 words after them (so 6 with the word itself). I have created an acceptfile with those rows and using grep but I have rows that have these words more... (2 Replies)
Discussion started by: A-V
2 Replies

10. IP Networking

Finding lost machine on network trouble

Couldn't find my PC on network. Root of evil the was in bad patch-cable. (0 Replies)
Discussion started by: useretail
0 Replies
XtMenuPopup()															     XtMenuPopup()

Name
  XtMenuPopup - built-in action for popping up a widget.

Synopsis (Translation Table)
  <Event sequence>: XtMenuPopup(shell_name)

Inputs
  shell_name
	    Specifies the name of the widget shell to pop up.

Availability
  This action is named MenuPopup prior to Release 4.

Description
  XtMenuPopdown  is a predefined action procedure which does not have a corresponding public C routine.  It can only be invoked from a trans-
  lation table.

  XtMenuPopup tries to find the named shell by searching the widget tree starting at the widget in which it is invoked.  If it finds a	shell
  with the specified name in the popup children of that widget, it pops up the shell with the appropriate parameters.  Otherwise, it moves up
  the parent chain to find a popup child with the specified name.  If XtMenuPopup gets to the application top-level shell widget and has  not
  found a matching shell, it generates a warning and returns immediately.

  If  XtMenuPopup is invoked on ButtonPress, it calls XtPopupSpringLoaded() on the specified shell widget.  If XtMenuPopup is invoked on Key-
  Press or EnterWindow, it calls XtPopup() on the specified shell widget with grab_kind set to XtGrabNonexclusive.  Otherwise,	the  transla-
  tion manager generates a warning message and ignores the action.

  XtMenuPopup  is specially registered with the translation manager as an action that will invoke a grab.  This registration is done by call-
  ing XtRegisterGrabAction() specifying owner_events True, event_mask ButtonPressMask	ButtonReleaseMask, and pointer_mode and keyboard_mode
  GrabModeAsync.

Usage
  Note that XtMenuPopup is an action procedure; you cannot call it from C code.

  MenuPopup is a synonym for XtMenuPopup.

  Popup  shells  can  also  be popped up explicitly using XtPopup(), XtPopupSpringLoaded() or one of the predefined popup callback procedures
  (see XtCallbackExclusive()).

  The action XtMenuPopdown can be used to pop down a shell widget from a translation table.

See Also
  XtMenuPopdown(1), XtPopDown(1), XtPopup(1), XtPopupSpringLoaded(1), XtRegisterGrabAction(1).

Xt - Pop Ups															     XtMenuPopup()
All times are GMT -4. The time now is 05:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy