Sponsored Content
Top Forums Shell Programming and Scripting Grabbing Keywords Below a Searched Keyword Post 302628463 by jl487 on Monday 23rd of April 2012 01:51:04 PM
Old 04-23-2012
Quote:
Originally Posted by Corona688
What's your system?
I'm running on an AIX machine.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print the files names that being searched

Hello all Im doing search in jar files using this oneLiener : find . -name "*.jar" -print -exec jar -tvf {} \; | grep -n \/someClassName.class but I also will like to see the jar file names that the grep succeed the search What I need to add to this command so it will give the file names? (2 Replies)
Discussion started by: umen
2 Replies

2. Shell Programming and Scripting

Using grep - check the permissions of the file searched

What I need to do is: I need to use the grep command to search for pattern in directory and sub-directories. And also I need to show the permission of file been seached by the grep command. Could any one please suggest me? ----------------- $> cat file1.txt A -----------------... (8 Replies)
Discussion started by: Johny001
8 Replies

3. Shell Programming and Scripting

how to get lines prior to the line being searched

Hi, Can anbody please let me know how i can retrieve lines above the line being searched in a file. I am looking for an error message from a file, if I see that message I want the lines above that message along with this line. how do we do this. Please do let me know An example which i have... (2 Replies)
Discussion started by: arunrao_oradba
2 Replies

4. OS X (Apple)

I have searched, but I am confused

Please forgive me if a similar question has already been asked.;) I have searched and found many possible solutions to my query. I would appreciate it if someone can point me to a thread to accomplish my task. I am trying to change values from a Master file to a File to be modified Since... (1 Reply)
Discussion started by: virgo
1 Replies

5. Shell Programming and Scripting

greping last occurrence of the searched string

Hello, I have active log file i want to grep the last occurrence of the word in that log file the log file gets on increasing and increasing i want to fetch it from live file. Please guide me, Thanks in advance (4 Replies)
Discussion started by: vidurmittal
4 Replies

6. UNIX Desktop Questions & Answers

limit number of sub-dirs searched for files

using: find . -type f -print|xargs -li "string", how do I limit the dated directories (2010-7-14, 2010-7-13,etc.) to just 2009 & 2010 years of directories to search. We go back to 2004 in our archives, way too many files. (3 Replies)
Discussion started by: MJThom713
3 Replies

7. Shell Programming and Scripting

How to get lines before and after a searched text?

Hi, I am trying to monitor alert log of oracle. i am searching based on ORA- error message if i find the line, i want the 2 to 3 lines before search line and 2 to 3 lines after the searched line. like for example, oracle has generated ORA7445 errors in the alert log, when i search for that... (18 Replies)
Discussion started by: bbnl
18 Replies

8. Shell Programming and Scripting

Search for a Keyword in file and replace another keyword or add at the end of line

Hi I want to implement something like this: if( keyword1 exists) then check if(keyword2 exists in the same line) then replace keyword 2 with New_Keyword else Add New_Keyword at the end of line end if eg: Check for Keyword JUNGLE and add/replace... (7 Replies)
Discussion started by: dashing201
7 Replies

9. Shell Programming and Scripting

Substitute first occurrence of keyword if occurrence between two other keywords

Assume a string that contains one or multiple occurrences of three different keywords (abbreviated as "kw"). I would like to replace kw2 with some other string, say "qux". Specifically, I would like to replace that occurrence of kw2 that is the first one that is preceded by kw1 somewhere in the... (4 Replies)
Discussion started by: M Gruenstaeudl
4 Replies

10. UNIX for Beginners Questions & Answers

How to write a script to match a searched name to a given list?

Full title: How to write a script to match a searched name to a given list, and then returns other names with the same properties Anyway, first time here, hi! So I'm taking an introductory course at uni and there's a question in our lab that asks us to write a script where a user can search a... (4 Replies)
Discussion started by: aheyhey
4 Replies
XGrabKey()																XGrabKey()

Name
  XGrabKey - grab a key.

Synopsis
  XGrabKey(display, keycode, modifiers, grab_window, owner_events,
	    pointer_mode, keyboard_mode)
	Display *display;
	int keycode;
	unsigned int modifiers;
	Window grab_window;
	Bool owner_events;
	int pointer_mode, keyboard_mode;

Arguments
  display   Specifies a connection to an X server; returned from XOpenDisplay().

  keycode   Specifies  the  keycode to be grabbed.  It may be a modifier key.  Specifying AnyKey is equivalent to issuing the request for all
	    key codes.

  modifiers Specifies a set of keymasks. This is a bitwise OR of one or more of the  following	symbols:  ShiftMask,  LockMask,  ControlMask,
	    Mod1Mask,  Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask, or AnyModifier.	AnyModifier is equivalent to issuing the grab key request for
	    all possible modifier combinations (including no modifiers).  All specified modifiers do not need to have currently assigned key-
	    codes.

  grab_window
	    Specifies the window in which the specified key combination will initiate an active grab.

  owner_events
	    Specifies whether the grab window should receive all events (False) or whether the grabbing application should receive all events
	    normally (True).

  pointer_mode
	    Controls processing of pointer events during the grab.  Pass one of these constants:  GrabModeSync or GrabModeAsync.

  keyboard_mode
	    Controls processing of keyboard events during the grab.  Pass one of these constants:  GrabModeSync or GrabModeAsync.

Description
  XGrabKey() establishes a passive grab on the specified keys, such that when the specified key/modifier combination is pressed, the keyboard
  may  be  grabbed, and all keyboard events sent to this application.  More formally, once an XGrabKey() call has been issued on a particular
  key/button combination:

  o  IF the keyboard is not already actively grabbed,

  o  AND the specified key, which itself can be a modifier key, is logically pressed when the specified modifier keys are logically down,

  o  AND no other keys or modifier keys are logically down,

  o  AND EITHER the grab window is an ancestor of (or is) the focus window OR the grab window is a descendent of the focus  window  and  con-
     tains the pointer,

  o  AND a passive grab on the same key combination does not exist on any ancestor of the grab window,

  o  THEN  the	keyboard  is  actively	grabbed,  as for XGrabKeyboard(), the last keyboard grab time is set to the time at which the key was
     pressed (as transmitted in the KeyPress event), and the KeyPress event is reported.

  The active grab is terminated automatically when the specified key is released (independent of the state of the modifier keys).  The KeyRe-
  lease event which terminates the active grab is sent to the grabbing window.

  The pointer_mode and keyboard_mode control the processing of events during the grab.	If either is GrabModeSync, events for that device are
  not sent from the server to Xlib until XAllowEvents() is called to send the events.  If either is GrabModeAsync, events for that device are
  sent normally.

  For more information on grabbing, see Volume One, Chapter 9, The Keyboard and Pointer.

Errors
  BadAccess When  using AnyModifier or AnyKey and another client has grabbed any overlapping combinations.  In this case, no grabs are estab-
	    lished.
	    Another client has issued XGrabKey() for the same key combination in grab_window.

  BadValue  keycode	    is	       not	   in	      the	  range 	between 	min_keycode	    and 	 max_
	    keycode as returned by XDisplayKeycodes().

  BadWindow

See Also
  XChangeActivePointerGrab(),  XGrabButton(),  XGrabKeyboard(),  XGrabPointer(),  XGrabServer(),  XUngrabButton(),  XUngrabKey(), XUngrabKey-
  board(), XUngrabPointer(), XUngrabServer().

Xlib - Grabbing 															XGrabKey()
All times are GMT -4. The time now is 07:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy